iOS 12 Siri Shortcuts with plist

Viewed 1294

I have an app that is functionally similar to this tutorial: https://www.raywenderlich.com/2829-objectively-speaking-a-crash-course-in-objective-c-for-ios-6

Basically, I have a plist filled with dictionaries, each containing two strings: a category and a quote. There are two different categories, each category has around 40 quotes.

I'd like to integrate with iOS 12's new Siri Shortcuts, in a way that allows users to ask something along the lines of "Hey Siri, what's a category A quote?" Or “Hey Siri, what’s a quote from category B?” (I know the user would have to record their own message, but that's the general idea).

I've looked online for tutorials, but none seem to cover plists with Siri. I should also note my app is in Objective-C.

Thanks in advance for all your help. I'm happy to provide more information if it's needed.

2 Answers

It doesn't matter your app is in Objective-C, Swift examples should work, unless you need to use Swift specific API.

Defining your custom intent definition with category and quote will help. Dispatching and handling actions related to your custom intent described in:

Also there's an example here, in Objective-C.

Related