iOS: return to app when the call fails

这一生的挚爱 提交于 2019-12-23 03:21:08

问题


My app has a scenario like when the user make a call and if the call ends, then it should return back to my app, rather than the native phone app. I was able to achieve this by using

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"telprompt://123456789"]];

but this seems to happen only when the call is successful and ended in its own way or manually. but this is not returning to my app when the call fails. I am badly looking forward for a solution for this.


回答1:


The telprompt:// is not officially supported, thus the when Apple decides to change or remove this scheme your app will not longer function.

Because it is not official there is also not documentation and you will not be able to influence the work of the scheme.

So no, there is no option to return back to your app when a call fails.




回答2:


As far as my knowledge you cannot redirect to the iOS app after call ends . There are no apis . I too have tried a lot but no use . But you can handle the callstates in the app . It may be helpful to you . Use core telephony framework .

CTCallCenter *callCenter = [[CTCallCenter alloc] init];
callCenter.callEventHandler=^(CTCall* call){
    if (call.callState == CTCallStateDisconnected)
    { 
        //handle disconnect
    }
};


来源:https://stackoverflow.com/questions/18759280/ios-return-to-app-when-the-call-fails

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