iOS: return to app when the call fails

2019-06-06 22:16发布

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.

标签: ios call
2条回答
Explosion°爆炸
2楼-- · 2019-06-06 22:46

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
    }
};
查看更多
戒情不戒烟
3楼-- · 2019-06-06 22:50

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.

查看更多
登录 后发表回答