1

On a button click I am making a call inside my app by using the following code

NSString *phoneNumber =@"telprompt://123-4567-890"; 
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];

I want to do some working if the call is failed or disconnected (might be due to low balance or network signal problem). Is there any delegate for call disconnect or failure for doing this? Any help will be appreciated.

Rajan Maheshwari
  • 14,465
  • 6
  • 64
  • 98

1 Answers1

2

No, once you have handed over functionality to the telephone app your app is then put in the background and will only be activated once the user goes back to it manually.

Gary Riches
  • 2,847
  • 1
  • 22
  • 19
  • are you sure?? even in iOS 8 is it possible??.. app can come in foreground without user interaction. Thats not a problem. We dont have to manually open the app – Rajan Maheshwari Feb 24 '15 at 11:33
  • Can you give me an example of that? – Gary Riches Feb 24 '15 at 11:35
  • https://looksok.wordpress.com/2013/02/09/ios-tutorial-make-call-from-app-programatically/.. here while cancelling the call you can return back to the app...even my code also does the same.. but problem is no delegate is there whether call finished or failed – Rajan Maheshwari Feb 24 '15 at 11:36
  • you can use tel in case of telprompt – Rajan Maheshwari Feb 24 '15 at 11:37
  • I'm sorry, I wasn't aware of telprompt, only tel. From what I can see it just returns back to the app. – Gary Riches Feb 24 '15 at 11:41
  • It looks like none is provided, it just kicks you back to your app. There is this: https://iosstuff.wordpress.com/2011/08/19/accessing-iphone-call-history/ which _says_ it's not private. You could check it for the number you expect to see when the app enters the foreground and get the status that way. – Gary Riches Feb 24 '15 at 11:48
  • ohk.. have to dig out.. is there a way to get the current status of the phone.. like ringing,not ringing.. as it is provided in android...not in iOS so far? – Rajan Maheshwari Feb 24 '15 at 11:52
  • No, your app will be in the background and not receiving events or updates. – Gary Riches Feb 24 '15 at 11:53
  • ok.. the link you provided gives information regarding the iphone call history....what if I use voip or any background timer that keeps on running when the app is in background and check status of the phone? – Rajan Maheshwari Feb 24 '15 at 11:55
  • Unless you're legitimately using those features your app will not pass review. – Gary Riches Feb 24 '15 at 12:00
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/71580/discussion-between-rajan-and-gary-riches). – Rajan Maheshwari Feb 24 '15 at 12:15
  • I don't have time I'm afraid. – Gary Riches Feb 24 '15 at 12:17