How to resume iPhone app after a Phone Call

徘徊边缘 提交于 2019-12-01 23:25:36

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!