Simple siri integration - ios

I'm integrating sirikit to my application.ie, searching flights which might come under ride booking category I guess.
My requirement is simple. If the user asks the Siri, "Hey Siri, search flights for delhi using my app". it will open my app's particular screen where I have the search screen(view controller).
For achieving that, I went through the sirikit implementation apple document.
What I have tried:
I configured my project with siri capability.
Added an intent extension(obj c language).
Requested siri authorization in appdelegate.
Added String to IntentsSupported in intent info plist.
From here, I need some clarifications and help. I was asked to Set the value of each item to the class name of the intent in the document. While adding intent extension, an intenthandler class file was added. what value should I add to items in info plist there?

Related

Referencing linked objects (emails, etc) created with Siri Smart reminders from EKReminder

I am building an application that allows to access/view user reminders in iOS, via the EventKit, and having issues figuring out how can I check if a reminder item has a linked item attached to it (such as an email)
Normally, these are created by using Siri - such as, "Hey Siri, remind me about this message".
Once a reminder is created this way, a little "mail" icon appears next to the reminder in Apple's Reminders app - I can click on that icon it it would transport me to the linked item (email in this case).
However, when I get a list of reminders (EKReminder objects, via EKStore's fetchReminders) in my app, I can't figure out how to access that information (such as, does a reminder item have a linked Siri object associated with it at all? And if so, how to access it in a way so that I could display a button in my app, clicking on which would open that linked object?)
It doesn't look like that information is even a part of the EKReminder/EKCalendarItem/EKObject structure… Where does it come from?
Thanks!

How does SiriKit parse commands for Pinterest

Could anyone enlighten me how does Siri recognise this sentence for Pinterest?
Pinterest: Find specific ideas you've saved: "Hey Siri, find women's
fashion Pins on Pinterest." https://www.imore.com/siri-apps-faq
I suspect its using INSearchForPhotosIntentHandling since the sentence has the closest reference to photos. The second thing I suspect is the use of Custom Vocabulary by swapping out "photo" with "Pins".
https://developer.apple.com/documentation/sirikit/registering_custom_vocabulary_with_sirikit
These are my current speculations for now, but I would like some clarity on this.
Use Case
I have an app that is centered around food reviews and I am hoping to integrate Siri to assist in Searching for food.
An example command:
"Hey Siri, find Japanese food in MY_APP."
"Hey Siri, find Japanese food reviews in MY_APP."
My keywords could be Food or Food Reviews or Reviews.
Siri process the request for your app based on the Intent that is supported by the app. There are only limited categories that is supported by Siri now.
So the siri know the vocabulary for these categories and it also uses your apps custom vocabulary to process the user given string to call the corresponding Intent from your extension.
IMO, you can consider reviews as notes and support INSearchForNotebookItemsIntentHandling by modifying the siri vocabulary.
Or the best way is to write to apple to add your corresponding domain in the siri's list of domains

show custom view for iOS location permission dialog

I am new to iOS. Is it possible to show a custom view or dialog in place of the default iOS location permission dialog?
No, this dialog is presented by the operating system and you cannot modify it. It is an important part of privacy management that the dialog is presented in a consistent way for all apps and that apps cannot modify the permission process.
You can display a custom view or alert prior to requesting permissions that explains what is happening and the need to click "allow" on the alert that is about to be presented
Direct Answer is it's not possible
explanation :
Only option is set description string by using Cocoa Keys(The keys associated with the Cocoa touch environments)
Add one of these key to
NSLocationWhenInUseUsageDescription
NSLocationAlwaysUsageDescription
Info.plist and set it's value to whatever which describe the purpose of getting location
ex:
MyApp picks you up from where you are. To book airport rides, choose “Allow” so the app can find your location.
Important: To protect user privacy, an iOS app linked on or after iOS 10.0, and which accesses the user’s location information, must statically declare the intent to do so. Include the NSLocationAlwaysUsageDescription key in your app’s Info.plist file and provide a purpose string for this key. If your app attempts to access the user’s location information without a corresponding purpose string, your app exits.
If you looking for localization for that message
Link

Can I use Siri kit to request information from my server?

I want to use Siri to show some data, it it was invoked.
For example if I was developing a news app.
Could I have it such that, if the user asks Siri 'what's the headlines from 'myapp''
It returns the top most headline according to my app
Actually You can't do thar with SiriKit (Intents.framework). The domains allowed are listed below (read more at Siri Programming Guide)...
VoIP calling
Messaging
Payments
Photo
Workouts
Ride booking
CarPlay (automotive vendors only)
Restaurant reservations (requires additional support from Apple)
Maybe what You are looking for is in the Speech Framework.

How to make Siri launch app on specific keyword?

When I say "Translate English to Spanish" Siri opens the app Google Translate.
How does Siri know to launch this app and is it possible to register your app for certain keywords with Siri?
Usually you can open an app telling Siri something like:
"Open [APP NAME]"
My guess
In your case I guess Siri is not interpreting the sentence. When you say Translate English to Spanish Siri does try to understand what action should take and since no action with an hight Matching Rate is found then Siri tries to open the App having a name equals to the first word of your sentence.
Test 1
In Italian language the app is named Traduttore. When I say Traduci dall'italiano all'inglese (Translate English to Spanish) Siri does NOT open the translator because Traduttore does not match Traduci.
Test 2
If I say: Musica dall'italiano all'inglese (Music italian to english) which is not a real command, Siri does open the Music app.
Siri and third parties apps
Right now the interaction between Siri and third parties apps is pretty limited, however maybe in the future Apple will provide the tools for a deeper interaction.
Maybe something like what is happening with HomeKit where Apple created an interface to make Siri and Home Devices to talk each other.
You should look at Siri's custom vocabulary.
At the moment it is limited to your App's name and Apple specified domains e.g. Workouts or Ride Booking
But if you're lucky enough that your application falls within those categories you can map some more app specific terminology.
For example, if you had a rock climbing application, Ascent, you could start with a voice command similar to "Hey Siri, start climb" rather than "Hey Siri, start workout with Ascent"
All of your localized vocab choices should be placed into their appropriate language-specific project directories (.lproj).

Resources