-4

I am a beginner in swift developpment.

I am looking for help to write the swift code that would give a call to a friend of my contact list, and:

  • if he answers to my call, it opens a chat window. (no vocal conversation, just chat). At the end of the call, it goes back to the app and the whole conversation is deleted definitly.
  • if he doesn't answer, it gives me the possibility to let an alert and when he connects himself to the app, he has a notification that ask him if he wants to call me back.

Here are a few lines, but can't figure out how to go on :

var phoneNumber: String = "telprompt://".stringByAppendingString(titleLabel.text!) // titleLabel.text has the phone number.
UIApplication.sharedApplication().openURL(NSURL(string:phoneNumber)!)
nhgrif
  • 61,578
  • 25
  • 134
  • 173
Rem
  • 1
  • 1

1 Answers1

1

What you are planning is as far as I know impossible. The code you wrote only launches the phone app and calls. You won't get any callbacks in your app from the phone app

Moriya
  • 7,750
  • 3
  • 35
  • 53
  • Maybe i can just write a function to send alerts to my friend when i want to call him ? – Rem Oct 25 '15 at 11:08