【发布时间】:2017-01-19 10:59:55
【问题描述】:
我打算创建一个 iOS VoIP 应用程序(之前没有做过任何 iOS 应用程序)。我正在阅读 IOS 中的 Callkit,通过它可以让他的应用程序通过 iPhone 原生通话屏幕接听电话。
我阅读了 Callkit api here,其中提到可以知道是否接听了电话。
通过this 教程,这里是检测呼叫被应答的代码:
-(void)reportIncomingCallWithHandle:(NSString *)handle
success:(void (^)())success
failure:(void (^)(NSError * error))failure {
CXCallUpdate *update = [self newCallUpdateWithHandle:handle];
self.callId = [NSUUID UUID];
[self.provider reportNewIncomingCallWithUUID:self.callId update:update completion:^(NSError * _Nullable error) {
if (error) {
if (failure) failure(error);
} else {
if (success) {
success();
}
}
}];
}
查看成功块。那么有没有办法在这个成功块执行时打开我的应用程序?或者我可以覆盖来电屏幕上的默认按钮来打开我的应用程序吗?
我知道在收到任何类型的通知或事件触发器时无法打开应用程序。因此,如果我可以使用 Callkit
做同样的事情,可能会有一些方法我在 Google 上搜索了所有内容,但没有发现有关上述查询的任何线索。如果可能,请帮助我。
【问题讨论】:
标签: ios objective-c iphone