6

Experimenting with the Xcode 10 beta, I've created a custom Siri Intent and it's working well. My Intents Extension successfully receives the intents and handles them in turn.

There is no validation of any sort needed on the parameters of the intent, once it is triggered it will request data from the network. I can do this in (void)handle....

I've noticed in my automatically generated Intent class, a list of possible response codes.

typedef NS_ENUM(NSInteger, SMSCheckTeamIntentResponseCode) {
    SMSCheckTeamIntentResponseCodeUnspecified = 0,
    SMSCheckTeamIntentResponseCodeReady,
    SMSCheckTeamIntentResponseCodeContinueInApp,
    SMSCheckTeamIntentResponseCodeInProgress,
    SMSCheckTeamIntentResponseCodeSuccess,
    SMSCheckTeamIntentResponseCodeFailure,
    SMSCheckTeamIntentResponseCodeFailureRequiringAppLaunch,
    SMSCheckTeamIntentResponseCodeSuccessPlayingNow = 100
}

The failure, success, and success (playing now) responses are defined in my Intents file. The others, such as ready, and in progress, are not, but I'd still like to tell Siri that my extension is "in progress" using the (void)confirm... method.

SMSCheckTeamIntentResponse * const response = [[SMSCheckTeamIntentResponse alloc] initWithCode:SMSCheckTeamIntentResponseCodeInProgress userActivity:nil];
completion(response);

At the moment, when I call this in the confirm method, Siri says something went wrong with my app, and the extension exits.

Does anyone know how to successfully use these response codes?

Ricky
  • 3,101
  • 1
  • 25
  • 33

0 Answers0