如何获取失败/掉线信息?我们有私人api吗?
答案 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]) {
}