4

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.

Branch
  • 387
  • 5
  • 16
  • You seem to be looking for something very explicit when you don't need to. You already have code that can read data from the plist. Now you need to write some code that can implement Siri shortcuts. Then you just link the two together. – Paulw11 Sep 16 '18 at 23:54
  • @Paulw11 I suppose you're right, I guess I'm just lost at the linking part, especially because I'm more familiar with Obj-C and most of the tutorials are written in Swift. Any help from anyone would be appreciated. – Branch Sep 18 '18 at 02:35

2 Answers2

3

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.

Ahmet Aygun
  • 612
  • 6
  • 19
  • For finding an OBJ-C example, bounty for you. Thanks.I guess I have to reach out to Apple to figure out why those guides show in Swift even when OBJ C is specifically set as the language. – Branch Sep 25 '18 at 23:02
0

All you need to do is create custom Intents and donate them to Siri.

The Soup Chef guide should help https://developer.apple.com/documentation/sirikit/soup_chef_accelerating_app_interactions_with_shortcuts?language=objc

ahbou
  • 4,710
  • 23
  • 36
  • Despite setting the language to Obj-C, the guide is still in Swift, as is the example download. As I said in my comment to PaulW11, I'm still at a loss on how to accomplish custom intents that can provide Siri with information from a plist _in Objective C_ – Branch Sep 19 '18 at 17:06