如何以编程方式获取失败/掉线信息?

时间:2013-03-27 10:28:40

标签: iphone ios ios6

如何获取失败/掉线信息?我们有私人api吗?

1 个答案:

答案 0 :(得分:2)

在iOS 10.0+上,请考虑使用CallKit:https://developer.apple.com/documentation/callkit


在iOS 4.0-10.0上,请考虑检查iOS Call Center API:https://developer.apple.com/documentation/coretelephony/ctcallcenter

示例:

self.callCenter = [[CTCallCenter alloc] init];

self.callCenter.callEventHandler = ^(CTCall* call) {


    if ([call.callState isEqualToString:CTCallStateIncoming]) {


    } else if ([call.callState isEqualToString:CTCallStateDialing]) {


    } else if ([call.callState isEqualToString:CTCallStateConnected]) {


    } else if ([call.callState isEqualToString:CTCallStateDisconnected]) {


    }