我正在处理voip通知实施。 我的版本在iOS 11的设备iPhone 6上运行良好。 但它在iOS 7与iOS 10.3.3版本上崩溃,并出现以下错误:
pushregistry:didreceiveincomingpushwithpayload:fortype:]:无法识别的选择器发送到实例
如果有任何身体出现此类问题,请帮助我。
答案 0 :(得分:1)
从iOS11弃用委托方法。 因此,请根据您的操作系统版本
执行以下代表@available(iOS, introduced: 8.0, deprecated: 11.0)
public func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, forType type: PKPushType) {
//do the necessary operations
}
@available(iOS 11.0, *)
public func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Swift.Void) {
//do the necessary operations
}
答案 1 :(得分:0)
您已使用如下所示的完成处理程序实现了委托方法。
- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload
forType:(PKPushType)type withCompletionHandler:(void (^)(void))completion;
请在没有完成处理程序的情况下实现相同的委托方法,如下所示。
- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload
forType:(PKPushType)type;
如果您需要更多帮助,请告诉我。