Ever felt the need to rush to SIRI to open something whose name you don’t seem to recall? You’re not alone.
We have been in the situation too.
So, we went through the same problem and solved this by teaching Siri to open the OYO App using different phrases like “Open Booking” based on the pronunciation of our users.
Siri shortcuts can also work with the OYO App now to show the details of your upcoming bookings and load them on the screen without even opening the application.
The latest feature in iOS 12 is Siri Shortcuts, a new technology that’s all about speeding up the things you do often. Shortcuts let you get things done either via suggestions within Settings/Siri & Suggestions on iPhone or iPad. You can also use the Shortcuts app to create/modify your own Shortcuts.
Ever since Siri was released in iOS 11, we strived to find out how it can make life easy for our customers. With iOS 12 and the new Shortcuts app, you can finally customize Siri.
Setup a workflow, then tell Siri what to do, shortcuts open up some exciting new avenues for productivity. It’s the first time you can teach Siri how to do whatever you want with the help of Custom Intents.
How to create a booking shortcut
In OYO, you are just three clicks away to create your booking.
- Create your booking
- Click on “Add to Siri” to add your bookings in the Siri shortcuts
- Speak your phrase after clicking the Voice icon
How to check your app shortcuts
Siri & Search: Launch the Settings app, then go to Settings > Siri & Search. Here, you can see your suggested Shortcuts based on your recent activity.
To check all your supported shortcuts click on “My Shortcuts”. As shown in the screenshot below, all of the shortcuts appear under this section.
App Shortcuts: To check all shortcuts suggested by the specific app, go to Settings > App Name > Siri & Search, there you can see all the shortcuts provided by your application.
“Wow! Thanks for letting me know about this feature, OYO. Now, how do I integrate this into my app”, you ask? No worries. We have got you covered.
If you are an iOS dev interested in integrating this feature into that awesome app of yours, follow the steps below:
Enable the Siri App Capability in Xcode
- Open your project in Xcode.
- Select your Capabilities tab in the app target.
- Enable the Siri capability.
This will add the Siri Service in your Apple ID with the Siri Entitlement file in your project.
Add an Intent Extension Target to Your Xcode Project
- Open your project in Xcode.
- Select: File > New > Target” from the MenuBar
- Click on the “+” icon to open the Suggested target screen
- Select “Intents Extension” and click Next.
- Enter the “Product Name” and click Finish
Create Your Intent
- Go to the Intents.intentdefinition file
- Create your own Intent (like Booking) as mentioned in the GIF image
- Build your project to tell Xcode to generate the Intent classes in your project.
- To configure language for your Intent class files, go to the Project and search for Intent Definition Compiler — Code Generation and choose the language
Create Intent Handler
- Create your own IntentHandler and confirm the same with the specific protocol of your Intent
- Write the necessary methods for your protocols and do all handling
- These protocol methods would be called when that Intent is fired by Siri
It means providing Siri with the information it needs to make a suggestion for an action that the user just completed. Siri looks for patterns in a user’s donated intents and periodically attempts to provide a relevant suggestion.
Donate your Intent with the help of INInteraction class, don’t forget to import Intent at the top.
You can also donate using “INUIAddVoiceShortcutButton” provided by IntentUI framework to add voice shortcuts in the app.
INUIAddVoiceShortcutButton It’s the “Add to Siri” button UI provided as per the Apple standards. It provides the following variations in your UI that you can configure within the Application
Once you have donated your shortcut, you can directly ask Siri to run your Intent.
Add UI to your Shortcut
To do that, let’s add IntentUI target to your application.
Now, we are going to change the code inside IntentViewController.swift file that has been created with the IntentUI target.
You can create your own UI inside mainInterface.storyboard
Now you can ask Siri for your Intent to check the created UI for the Intent.
The last thing pending is to handle the intent inside of the app. When the user taps on the shortcut, they will be taken to the app, and your app needs to send them to the right place.
To configure the custom landing in your application
1. Go to the Appdelegate.m
2. Add your functionality as described in screenshot
In the comments section below, don’t forget to share the interesting implementations of Siri you have encountered!.
Head over to the App Store to update the OYO app to the latest version and experience this feature in action.