initiate call then return to app

Discussion in 'iPhone/iPad Programming' started by XcodeNewb, Feb 28, 2009.

  1. macrumors member

    Joined:
    Feb 6, 2009
    Messages:
    79
    #1
    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
     
  2. Moderator

    dejo

    Staff Member

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

    Joined:
    Jun 30, 2008
    Messages:
    21
    #3
    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
     
  4. ulbador, Dec 22, 2010
    Last edited: Dec 22, 2010

    macrumors 68000

    ulbador

    Joined:
    Feb 11, 2010
    Messages:
    1,554
    #4
    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/...e/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.
     
  5. TAKEphONE, Dec 22, 2010
    Last edited: Dec 24, 2010

    macrumors newbie

    Joined:
    Jun 30, 2008
    Messages:
    21
    #5
    Wow that was fast... Thanks !

    Will post my success/failure here.

    Edit: Worked !!!
     
  6. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    Messages:
    2,675
    #6
    What worked? What did you implement?
     
  7. macrumors newbie

    Joined:
    Jun 30, 2008
    Messages:
    21
    #7
    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.
     

Share This Page