0

I created an iOS App Extension and defined a single entry INPlayMediaIntent in the extension's plist IntentsSupported array. Everything was fine. But since a few days (WWDC 2019) i have trouble submitting the app to TestFlight/App Store Connect.

I followed Apple's instructions and fixed these errors:

Now I'm trying to provide an intent parameter in the AppIntentVocabulary.plist here:

<dict>
    <key>ParameterVocabularies</key>
    <array>
        <dict>
            <key>ParameterNames</key>
            <array>
                <string>INPlayMediaIntent.mediaItems</string>
            </array>

I tried it with various strings and all were wrong according to these App Store emails:

  • ITMS-90626: Invalid Siri Support - "INPlayMediaIntent.mediaItems" is not a supported intent parameter of the subscribed intents

  • ITMS-90626: Invalid Siri Support - "INPlayMediaIntent.mediaContainer" is not a supported intent parameter of the subscribed intents

  • ITMS-90626: Invalid Siri Support - "INPlayMediaIntent.identifier" is not a supported intent parameter of the subscribed intents

What would be a valid parameter name for an INPlayMediaIntent?

It could be so easy because Apple has an example project for INPlayMediaIntent here which i used to learn for my project:

https://developer.apple.com/documentation/sirikit/media/playing_media_through_siri_shortcuts

But: This project seems not to be up to date since it is missing the AppIntentVocabulary.plist which seems to be required recently.

MacMark
  • 6,239
  • 2
  • 36
  • 41

2 Answers2

1

I want to give an answer to the actual question since the documentation is quite misleading in that regard. If it were correct then only "key path[s] for a property name from an intent class" would be allowed which doesn't make any sense for INPlayMediaIntents. To find the correct answer I watched Design high quality Siri media interactions and at 12:20 we can see a slide with a mapping from user vocabulary symbols (strongly typed) to the Strings to use in the AppIntentVocabulary.plist.

The general idea to check whether a key is supported is to go to INVocabularyStringType and check for the ones starting with the corresponding Siri domain (in this case media<SomeThing>) and then use INPlayMediaIntent.someThing for the ParameterNames array in the plist.

In the Managing Audio with SiriKit sample code we can see an example using INPlayMediaIntent.playlistTitle.

fruitcoder
  • 1,073
  • 8
  • 24
0

I contacted Apple's developer support and got this answer:

"You should be able to submit your app to AppstoreConnect without seeing these warnings. Please submit a complete bug report regarding this issue …"

I reverted my changes that tried to fix the initial error messages and my current build did not get warnings anymore.

Handling the intent works this way:

- (void)application:(UIApplication *)application handleIntent:(INIntent *)intent completionHandler:(void (^)(INIntentResponse * _Nonnull))completionHandler {
        INPlayMediaIntent *mediaIntent = (INPlayMediaIntent *)intent;
        INMediaItem *mediaItem = [mediaIntent.mediaItems firstObject];
        NSString *myId = mediaItem.identifier;
        INMediaItemType mediaType = mediaItem.type;
// play some media identified by myId and mediaType
        INPlayMediaIntentResponse *response = [[INPlayMediaIntentResponse alloc] initWithCode:INPlayMediaIntentResponseCodeSuccess userActivity:nil];
        completionHandler(response);
}
MacMark
  • 6,239
  • 2
  • 36
  • 41
  • How you handled Media intents (INPLayMediaIntent)? can you share code? @MacMark – Divyesh Oct 15 '20 at 09:34
  • I added the handling to may answer @Divyesh_08 – MacMark Oct 16 '20 at 12:28
  • I am trying to play podcast episode using "Play the Overlap by audiochuck from CounterClock podcast in audiosirikitdemo" but when HandleIntent get called in AppDelegate in that I am just getting CounterClock in MediaSearch object. Do you know how to get Podcast and it's episode's name in siri? @MacMark – Divyesh Oct 29 '20 at 07:58
  • The intent has an identifier and an intentDescription. Maybe there? – MacMark Oct 30 '20 at 13:02