initiate call then return to app

Discussion in 'iOS Programming' started by XcodeNewb, Feb 28, 2009.

  1. XcodeNewb macrumors member

    Feb 6, 2009
    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?

  2. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    I would suggest saving the current state in the applicationWillTerminate: method of your app's delegate and then restore than state upon restart.
  3. TAKEphONE macrumors newbie

    Jun 30, 2008

    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 ?

  4. ulbador, Dec 22, 2010
    Last edited: Dec 22, 2010

    ulbador macrumors 68000


    Feb 11, 2010
    You would have to use one of the 7 backgrounders available (probably something like the local push notifs) and then use this framework:

    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.


    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.
  5. TAKEphONE, Dec 22, 2010
    Last edited: Dec 24, 2010

    TAKEphONE macrumors newbie

    Jun 30, 2008
    Wow that was fast... Thanks !

    Will post my success/failure here.

    Edit: Worked !!!
  6. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
  7. TAKEphONE macrumors newbie

    Jun 30, 2008

    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.


Share This Page