Recommend shortcut in Siri after creating Siri shortcut - React Native - ios

I have successfully implemented shortcut in React Native project via react-native-siri-shortcut npm.
I am able to see all those shortcuts in Shortcut app(in iOS).
When I open Siri and speak them, Siri just opens my app.
I have added SiriShortcutListener in my app, and just displayed alert.
I don't know how to make Siri recommend some stuff or perform the action as I want it to.
Do I have to make any UI for that? Also, how activityType should be used?
Any proper link or tutorial/help will be appreciated.

I'm not sure how the Siri shortcut will work on react-native but as a part of iOS native app development, you have to add SiriKit Intent Definition File to your project.
Once you add that file to your project you will have to add New Intent and have to configure it the way you would like to utilize it in your app.
I hope it will give some hint on your further research or developing.

Related

Is there a way to package a Siri Shortcut Automation as part of my iOS App?

I have created a Siri Automation from Shortcuts app. Like, everytime the user opens Music app, it redirects to Safari. This was just for the purpose of experimentation. Can this be "Packaged" in a swift app that I am creating?
Basically, I want something like an Install Automation button in my app, that will install this automation (with user's permission, of course) to the user?
One way I can think of is by sharing this new shortcut as an iCloud link - https://support.apple.com/guide/shortcuts/share-shortcuts-apdf01f8c054/ios
Having an icloud link, your app can request Safari to open this link and then the user can install it by clicking on "Get Shortcut".
So yeah, a pretty straightforward way I think.

Intent does not appear in Supported Intents

Link to all the code I'm working with so far: https://github.com/banool/respose.
I want to make an app where it is possible for users to activate some intent it defines as an action in response to some event in the iOS shortcuts app. For example:
If I open app X.
Run intent from my app instead.
I've seen this done before in other apps, so I know it's possible.
I have an intent defined (see attached code as well as image) that seems to be correct as far as I can tell. I don't think I need an intent extension because I don't intend to handle the intent in the background or via Siri.
I notice that when I try to add an intent under My Target -> General -> Supported Intents, the dropdown doesn't show my intent, only the built in system intents.
I'm not sure what I'm doing wrong here. I got to this point just by following the official guide from Apple: https://developer.apple.com/documentation/sirikit/adding_user_interactivity_with_siri_shortcuts_and_the_shortcuts_app.
I don't think the fact that I'm using Flutter should matter so much right now (I figure that's more of a concern for when the app actually opens up from the shortcut), but perhaps I'm wrong.
I have registered the app on App Store connect and I'm using an identifier that has the sirikit capability enabled. I've also added the "Siri" capability in XCode. I've tried this on both a simulator and a real device, the results are the same.
Any help would be much appreciated, thanks!
Had the same issue.
It seems that you can just type the class name without prompt, and it should work just fine. Don't forget to select proper target though

SiriKit iOS13 - Siri Dialog not coming

I am integrating SiriKit into my iOS 13 app.
For that I am using Apple's Sample app - Soup Chef for understanding it.
In my Custom Intent, I have selected Ask Each Time in Shortcuts App for quantity value.
But, When I run the shortcut from Hey, Siri!, it redirect me to Shortcuts App, instead of Siri asking me about quantity.
I have Siri Dialog enabled already.
How can I force Siri to ask me the question, instead of getting redirected to Shortcuts App?
This seems to be an issue in iOS13.0. Try running this on a device running iOS13.1, and it should work.
SiriKit stopped using Siri Dialog prompts (iOS13.1)
https://forums.developer.apple.com/thread/122235
Apple is in the process of integrating the new version of Siri. So it deactivates some features.

Start SIRI from iOS Application

I want to start siri programmably from my application.
There is any way to do it from my app like launch another app from package name ?
Nope. I think you're looking for a uikit class analogous to NSWorkspace on the mac. There is no NSWorkspace api. That said, You can ask your application to open a URL who's scheme is handled by another application, but that won't work for siri unless siri has a scheme... maybe... siri://?

Sirikit launching the app fully instead of showing in own scroll

I have just created single view controller app and adding targets with Siri extensions( intents and intent ui extension).
But when I say Siri command to start the intent it just launching the app instead of showing in Siri view itself. Since I have started exploring Siri please let me know the issue and if any tutorial I can go through
I had the same problem. The bug was that the extension's plist contained the wrong entry in NSExtensions->NSExtensionAttributes->IntentsSupported – obviously the default Xcode actions are incorrect.
What you need to state there are the actual class names of the intents you handle, not their names as per the intentdefinition file.
Disabling 'copy only when installing' under Embed App Extensions in main target build phases fix the issue for me.
You should follow these steps:-
Add intents and intentsUI(if you need to customize default UI) as
extension
Override the Intent handers
Mention your intents in info.plist
Allow app to be accible by siri in phone settings
The best way to start is to go thru the SiriKit Programming Guide
Also, you can get some sample code from Apple here

Resources