INPlayMediaIntent ignores the term "video"

Viewed 27

I'm setting up SiriKit on my app, and so far so good, but I've found that when defining user vocabulary for playlist names, that anything with the word "video" gets ignored. "videos" fares a little better, but still doesn't result in the behavior I'd expect (more on that below).

I have the following code in my AppDelegate's didFinishLaunchingWithOptions func:

let playlistTitles = [
    "trending video"
]

let vocabulary = INVocabulary.shared()
let playlistTitleSet = NSOrderedSet(array: playlistTitles)
vocabulary.setVocabularyStrings(playlistTitleSet, of: .mediaPlaylistTitle)

When I run my app using the this command Play trending video in the {App} and attach a breakpoint in my IntentHandler I can see that the mediaSearch object is nil.

If I change the playlist name in my vocabulary code to "shardy jeans" and then hit the same breakpoint I see the mediaSearch object I'd expect:

<INMediaSearch: 0x104b45550> {
    reference = 0;
    mediaType = 5;
    sortOrder = 0;
    albumName = <null>;
    mediaName = shardy jeans;
    genreNames = (
    );
    artistName = <null>;
    moodNames = (
    );
    releaseDate = <null>;
    mediaIdentifier = <null>;
}

I then went and edited my playlist names in the vocabulary to include "trending videos" (instead of "trending video"), this at least returned a mediaSearch object that included a mediaName, however, in this case there was no mediaType of .playlist like in the previous example:

<INMediaSearch: 0x104a498b0> {
    reference = 0;
    mediaType = 0;
    sortOrder = 0;
    albumName = <null>;
    mediaName = trending videos;
    genreNames = (
    );
    artistName = <null>;
    moodNames = (
    );
    releaseDate = <null>;
    mediaIdentifier = <null>;
}

Any ideas on how I can get "trending video" recognized as a playlist name in my user vocabulary for the app?

0 Answers
Related