PDA

View Full Version : initiate call then return to app




XcodeNewb
Feb 28, 2009, 08:13 PM
Is it possible to initiate a phone call from an app then return to the app ( in the view it left from ) as though nothing happened?

I can initiate the call using the "tel" option with the openURL command, but when the call ends it relaunches the app from the beginning? Is is possible to return to where they left?

Thanks



dejo
Feb 28, 2009, 09:56 PM
I can initiate the call using the "tel" option with the openURL command, but when the call ends it relaunches the app from the beginning? Is is possible to return to where they left?
I would suggest saving the current state in the applicationWillTerminate: method of your app's delegate and then restore than state upon restart.

TAKEphONE
Dec 22, 2010, 11:49 PM
Is it possible to initiate a phone call from an app then return to the app ( in the view it left from ) as though nothing happened?

I can initiate the call using the "tel" option with the openURL command, but when the call ends it relaunches the app from the beginning? Is is possible to return to where they left?

Thanks

Hi,

I think I am missing something here - I am using OpenURL from my app to start a call, but unless the call fails - it does NOT return to my app after the call ends - it launches the built-in call-log.

I see an app called NoseDial that when it starts a call, after the call ends, it displays a popup dialog asking if the user wants to quit the app or return to it.

How can this be done ?

TIA

ulbador
Dec 23, 2010, 12:08 AM
You would have to use one of the 7 backgrounders available (probably something like the local push notifs) and then use this framework:

http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Reference/CoreTelephonyFrameworkReference/_index.html

I have a feeling depending on which one you use and how you use it, the callback notification is a little delayed. I was using the TomTom app today while receiving calls like crazy, and the popup from TomTom always took like 10 seconds after the call started to pop up.

The local notification then would act a lot like a normal push you get. You could either close the notif or click the button to relaunch the app.

This would have to be a backgrounded application to be able to relaunch after the call was done. Otherwise the user would have to manually relaunch.


Edit:

After looking over that framework a bit, I really wonder what is allowed and how it is allowed. Although it looks pretty basic, it looks like an app developer can detect when a call is made/in progress/hung up plus retrieve the callID, though that callID may not be the "real" one, rather a generic one. Could definitely make for a nefarious as well as useful app or two.

TAKEphONE
Dec 23, 2010, 12:45 AM
You would have to use one of the 7 backgrounders available (probably something like the local push notifs) and then use this framework:

http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Reference/CoreTelephonyFrameworkReference/_index.html

I have a feeling depending on which one you use and how you use it, the callback notification is a little delayed. I was using the TomTom app today while receiving calls like crazy, and the popup from TomTom always took like 10 seconds after the call started to pop up.

The local notification then would act a lot like a normal push you get. You could either close the notif or click the button to relaunch the app.

This would have to be a backgrounded application to be able to relaunch after the call was done. Otherwise the user would have to manually relaunch.


Edit:

After looking over that framework a bit, I really wonder what is allowed and how it is allowed. Although it looks pretty basic, it looks like an app developer can detect when a call is made/in progress/hung up plus retrieve the callID, though that callID may not be the "real" one, rather a generic one. Could definitely make for a nefarious as well as useful app or two.

Wow that was fast... Thanks !

Will post my success/failure here.

Edit: Worked !!!

PhoneyDeveloper
Dec 24, 2010, 04:48 PM
What worked? What did you implement?

TAKEphONE
Dec 25, 2010, 12:18 AM
What worked? What did you implement?

Hi,

On iOS4, you can register to telephony notifications, and know when my call ends.

But this only works as long as my app "lives".

So I had to use async task to let the OS know my app wants to do something in the background, and keep it alive.

Then when I get the notification about the call going IDLE, I use the local notiication mechanism to set a notification for a second later. That notification pops a dialog allowing the user to re-launch the app.

Thanks.