How to resume iPhone app after a Phone Call

后端 未结 1 1852
面向向阳花
面向向阳花 2021-01-22 04:23

I am creating an iPhone app in which I am providing a call feature with the help of which a user can call place a call on a specified number. I am able achieve the above feature

相关标签:
1条回答
  • 2021-01-22 04:34

    Apple does not allow you to resume an app after a phone call. What you can however try doing is using a local notification.

    After calling the 'call' url handler you will need to start a background task and monitor for a call state change:

    CTCallCenter *c=[[CTCallCenter alloc] init];
    c.callEventHandler=^(CTCall* call){
      if(call.callState == CTCallStateDisconnected) {
        // do stuff here
      }
    }
    

    When you get a call state change, create a local notification to alert the user to resume the app. If the user taps on "view" your application will then come to the foreground. Obviously if the call is longer than 10 minutes this won't work as Apple only allows 10 minutes to background tasks.

    0 讨论(0)
提交回复
热议问题