application:continueUserActivity:restorationHandler:在iOS 11中未调用

Nee*_*esh 4 xcode objective-c ios ios11

我有一个集成了callkit的Voip应用程序.它在iOS 10中运行良好,现在我似乎在使用原生临时(iOS最新版本)调用iOS 11时遇到问题.

- (BOOL)application:(UIApplication *)application willContinueUserActivityWithType:(nonnull NSString *)userActivityType {}

- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray * _Nullable))restorationHandler {}
Run Code Online (Sandbox Code Playgroud)

这两种方法都没有被调用,因此我无法处理NSUserActivity INStartAudioCallIntent.我错过了iOS 11中明显改变的东西吗?

提前致谢.

RJV*_*mar 9

验证remoteHandle和supportedHandleTypes,两者都应该符合您的要求.

    callUpdate.remoteHandle = [[CXHandle alloc] initWithType:CXHandleTypeGeneric value:[NSString stringWithFormat:@"%@", phoneno]];
Run Code Online (Sandbox Code Playgroud)
    configuration.supportedHandleTypes = [NSSet setWithObjects:[NSNumber numberWithInteger:CXHandleTypeGeneric],[NSNumber numberWithInteger:CXHandleTypePhoneNumber], nil];
Run Code Online (Sandbox Code Playgroud)

如果句柄不匹配,则无法处理NSUserActivity.