Learn foolproof ways to surface your app's actions in the Shortcuts app — and help people quickly set up powerful, personalized shortcuts using system intelligence. We'll detail how to configure your intents to appear in the new Automation Suggestions, explore how the system surfaces your app's actions for people based on their everyday app usage, and show you how you can make sure your app appears in all the right places within the Shortcuts app.
Hi, everyone. My name is Ayaka, and I'm here to show you how to get your app's actions featured in the Shortcuts app. In this session, we're gonna focus on two things.
First, we're gonna talk about automation suggestions. Specifically, we'll talk about how your app's actions can be featured as a part of automations that are suggested by the system. Next, we'll briefly talk about how your actions can be surfaced in the Shortcuts Gallery and the Shortcuts Editor so people can more easily discover and create their own shortcuts with them.
Before we talk about automation suggestions, let's talk about automations.
In iOS 13, we introduced personal automations.
Personal automations allow you to run shortcuts automatically based on a specific condition.
For example, one of my simplest and favorite automations I have is one that opens my reading list when I arrive at my local bookstore so I know exactly what I should look for.
Alongside automations in iOS 13, we also introduced automation suggestions in the Shortcuts Gallery, which are centered around daily routines, like going to and from work.
In iOS 14, we extended it to support all actions, including user activities, system intents such as INPlayMediaIntent, and custom intents that your app defines.
By having your app donate interactions when a person does something in your app, the system will learn and make suggestions for things that they might want to automate.
Here, because I use Duolingo a lot in the evening, I'm getting a suggestion to practice my French every weekday at 9:00.
I think that's a pretty useful automation, and something that could help strengthen my habit.
I'm gonna tap on the suggestion to add it.
And then all I have to do is tap "Add Automation" to add it to my collection.
And here it is in my automations list along with my other automation.
We think it's a great, simple experience for people, especially for those who are just getting their feet wet in the world of automations. As I briefly mentioned earlier, these suggestions are made possible through donations of interactions when a person does something in your app.
In fact, donating is the only thing that you need to do in order for the system to learn and make these suggestions.
Let's see what that looks like in code.
Let's say I have a soup delivery app, and I want to donate a order.soup intent when a person, well, orders a soup.
First, I'm gonna initialize the intent, which I've named PlaceOrderIntent.
Next, I need to know what I'm ordering, specifically which soup, so I'm gonna get my soup from this order object I have.
Then I'm gonna set the intent's soup property to an INObject that represents the soup.
Next, I'm gonna set some images for my parameters, one for the soup and one for the delivery location.
And then I'll wrap the intent in an INInteraction.
And finally, I'm gonna call donate on the interaction to tell the system that someone ordered a soup.
The types of actions that are supported by automation suggestions include system intents, as well as custom intents and user activities.
Because intents can run in the background without having to open the app, we recommend using intents here. If you want to learn more about how your app can adopt intents, you can check out some of these past talks.
The first one is "Introduction to Siri Shortcuts," which shows you the fundamentals of how shortcuts work with intents. And the second one is "Introducing Parameters for Shortcuts," which shows you how to make your shortcuts even more powerful by supporting user-configurable parameters.
By the way, we support many different automation types.
We have automation types ranging from time of day to when you arrive at a location to when you connect to a particular Bluetooth device.
As someone who turns on my reading lights every evening, I might get a suggestion for setting my "reading time" home scene every evening at 8:00.
Or as someone who calls in to a lot of meetings on my phone, I might get a suggestion for dialing in to my conference room every time I connect my AirPods.
The types of automations that the system could suggest are as endlessly unique as people's habits and routines.
Going back to this list of suggestions, another thing I want to explore further today is Daily Routines.
Daily Routines are a special type of automation suggestion that we introduced last year. These are centered around a person's routine, and there is a personalized, step-by-step flow that guides people through the process of setting up a multistep automation.
Specifically, we have three of them.
One for going to work, one for going home, and another for when you're at the gym.
There are several opportunities for your app to be a part of these flows. For example, if you're a media app that plays music, podcasts or audiobooks, you can be a part of all three of these flows in the "Play Media" step by adopting INPlayMediaIntent.
If you're a workouts app, you can be a part of the "At the Gym" routine by adopting INStartWorkoutIntent.
Let's walk through what it looks like to set up a daily routine.
I'm gonna tap on the first suggestion here to set up a "Going Home" routine.
There's a step-by-step flow that guides me through the process of setting up this automation.
For example, for "Going Home," it first asks me what media I want to play.
If your app plays media, your app can show up on this list as well.
You can do this by adopting and donating INPlayMediaIntent to inform the system that someone played some media. Over time, if that person does this consistently and the predictions model correlates this action with their commute, the Shortcuts app will start suggesting it as a part of this flow.
Once I choose my playlist, I can choose to include getting directions home. After that, I get an option to send a contact of my choice an ETA for getting home.
For example, something like, "I'll be home at 6:30." And finally, I can choose if I want this to be an automation or a shortcut that I run manually.
I'm gonna select "Show Automatically" here.
And once I do that, it gets added to my automations list here to run ten minutes before leaving for home.
And this is the full shortcut that got added to my library.
It first starts playing some music, then gets driving directions to my home in the Maps app, followed by the estimated driving time to get home, and finally, it sends a message with my ETA.
I was able to set up this personalized multistep shortcut with just a few taps thanks to Daily Routines.
So, if you're a media app, be sure to adopt INPlayMediaIntent, and if you're a workouts app, be sure to adopt INStartWorkoutIntent to be a part of the Daily Routines flow.
That wraps up automation suggestions. Now let's talk about the Gallery and Editor.
Specifically, we'll take a look at the "Shortcuts from Your Apps" section in the Gallery, and the Shortcuts Editor.
This is what the "Shortcuts from Your App" section looks like in the Gallery. If I tap on "See All," I see even more shortcuts.
Today I want to demystify how these shortcuts are being curated.
One way to show up in this list is by setting shortcut suggestions using INVoiceShortcutCenter. In code, it might look something like this.
First, I'm gonna take my OrderStatusIntent and wrap it in an INShortcut. I'll do the same for my TopSoupsUserActivity, put them all in a suggestions array, and finally, call setShortcutSuggestions with those suggestions.
In addition, similar to automation suggestions, we can be more intelligent about what shows up by relying on donations, which I showed you how to do earlier.
These are suggestions based on how people interact with their apps, including things that they have done recently.
So, those are the two ways that you can get your app's actions to show up in the Gallery.
In addition to the Gallery, these same actions will also surface in the Shortcuts Editor.
Here, the suggestions are based on donations for things a person has done. For example, I'm getting some suggestions for music I might want to play based on my playback history, along with some suggestions for streaks I'm trying to maintain.
A person can also tap on the "Apps" button, which is up here, to see a list of all their apps that support shortcuts.
For example, I can look at all the actions that the Streaks app is offering me.
There are a lot of actions here, so let's break it down.
This is based on a combination of things.
First, the actions down here are shortcuts that were suggested using INVoiceShortcutCenter, or donated.
Also, if the action supports key parameters, it shows up with a row of parameter options like what we see here under "Complete Task," like "Run Five Miles" or "Study French." Second, the actions up here come from intents that are marked "configurable." If your intent is configurable, it will show up even if you don't donate or suggest it.
If you want to make sure a particular set of actions always shows up, we recommend using INVoiceShortcutCenter to set suggestions in addition to donating user interactions in your app, just like what we talked about for the Gallery. In addition to suggesting shortcuts, donating actions, and making intents configurable, there's also one more way to include your actions in the Shortcuts Editor. That is, some system intents will show up in the Shortcuts Editor without having to suggest shortcuts or donate actions. Specifically, those system intents are SendPayment, RequestPayment and RequestRide.
So, let's talk about next steps.
First, consider providing your app's actions to the system using INVoiceShortcutCenter's setShortcutSuggestions API.
Second, please donate your intents during regular app usage so the system can learn to feature your app in the Gallery as a part of automation suggestions, and in the editor as suggested actions.
There are more opportunities than ever to be featured in the Shortcuts app.
Thanks for watching, and we can't wait to see what shortcuts people create with their app's actions.
Looking for something specific? Enter a topic above and jump straight to the good stuff.
An error occurred when submitting your query. Please check your Internet connection and try again.