0

On my SiriKit demo project, I did handle INSendMessageIntent on MyMessageHandler object, and implements the methods define by protocol INSendMessageIntentHandling, one of that:

- (void)handleSendMessage:(INSendMessageIntent *)intent completion:(void (^)(INSendMessageIntentResponse * _Nonnull))completion {
    NSLog(@"%@", NSStringFromSelector(_cmd));
    NSUserActivity *userActivity = [[NSUserActivity alloc] initWithActivityType:NSStringFromClass([INSendMessageIntent class])];
    userActivity.title = NSStringFromClass([INSendMessageIntent class]);
    INSendMessageIntentResponse *response = [[INSendMessageIntentResponse alloc] initWithCode:INSendMessageIntentResponseCodeSuccess userActivity:userActivity];
    completion(response);
}

I did set value of title property with a string and make sure userActivity is not a nil object. and then, I implements method named:(BOOL)application:continueUserActivity:restorationHandler: on AppDelegate.m and returned YES

And now, the problem is coming:

run the main program, then, debug the Extension program.

the method (BOOL)application:continueUserActivity:restorationHandler: did not be called, and i already added the item named:INSendMessageIntent for IntentsSupported array on info.plist file in Extension program.

  • Xcode 8.2.1

Thanks!

arnoldxiao
  • 21
  • 3

1 Answers1

0

Try returning the response with INSendMessageIntentResponseCodeInProgress

ondermerol
  • 524
  • 1
  • 11
  • 29