I have an audio based test application that I am adding Siri support to. The application currently responds to the PlayMedia intent and correctly plays the desired media, but Siri does not seem to want to acknowledge that the playback has begun by showing status text above the Siri indicator.
Illustrating this by example, take the command "Play Fleetwood Mac on _______".
Here is the result on Spotify:
Here is the result on my test app:
As you can see, when playing on Spotify, Siri "replies" to the request by showing "Fleetwood Mac now playing on Spotify...". Conversely, this text does not appear when trying this in my test app.
Here is my intent handler code:
#pragma mark - INPlayMediaIntentHandling
-(void)handlePlayMedia:(INPlayMediaIntent *)intent completion:(void (^)(INPlayMediaIntentResponse *response))completion {
INPlayMediaIntentResponse * const response = [[INPlayMediaIntentResponse alloc] initWithCode:INPlayMediaIntentResponseCodeHandleInApp userActivity:nil];
completion ? completion(response) : nil;
}
-(void)resolveMediaItemsForPlayMedia:(INPlayMediaIntent *)intent withCompletion:(void (^)(NSArray<INPlayMediaMediaItemResolutionResult *> * _Nonnull))completion {
INMediaItem * const mediaItem = [[INMediaItem alloc] initWithIdentifier:[[SongController sharedInstance] songIdentifier] title:[[SongController sharedInstance] songTitle] type:INMediaItemTypeSong artwork:nil];
INPlayMediaMediaItemResolutionResult * const result = [INPlayMediaMediaItemResolutionResult successWithResolvedMediaItem:mediaItem];
completion ? completion(@[result]) : nil;
}
And the intent handling code in my app delegate:
-(void)application:(UIApplication *)application handleIntent:(INIntent *)intent completionHandler:(void(^)(INIntentResponse *intentResponse))completionHandler {
[[SongPlaybackController sharedInstance] beginPlayback];
INPlayMediaIntentResponse * const response = [[INPlayMediaIntentResponse alloc] initWithCode:INPlayMediaIntentResponseCodeSuccess userActivity:nil];
[response setNowPlayingInfo:[[SongController sharedInstance] songNowPlayingInfo]];
completionHandler ? completionHandler(response) : nil;
}
Why is Siri not showing any text when I play back the content in my test app? How can I get her to show "Fleetwood Mac now playing on (my app)..."?
Oddly enough it seems like this code just started working after I restarted my device. Disregard?