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
Related
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
I'm trying to incorporate SiriKit intents into my application. I followed all the instructions including
Enable SiriKit
Add the usage string in Info.plist
Add the intent extension target to the project
Add the intent I want to support in the Info.plist of that new target
Add my handler method for the intent
Add the SiriKit authentication request in the AppDelegate
When I open Siri now and I ask the required question for the intent it does ask me if I want to open my app, so I go ahead and click yes and my app is opened. However, no print-statement in my intent handling method nor a breakpoint in there is hit.
I also tried starting the intent extension scheme via the run button in Xcode, I select my app on the popped up drop down, but then nothing on the phone appears and it just says Finished running my app on the device, no print statement or breakpoints hit either.
Does anybody know what I'm doing wrong here?
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.
I’m trying to get a voice shortcut for a custom Siri Intent working as part of an Apple Watch app, but I’m not sure whether that’s possible. Has anyone had success with this or know if it’s supported?
There isn't much code to share in this case, since most of the code is auto-generated by Xcode, but here’s a quick overview of how I have everything set up.
I created a custom Intent with a .intentdefiniton file and separate Intents Extension targets for my iOS app and watchOS app to handle the Intent.
I set up and donate the shortcuts at the appropriate time. I included an INUIAddVoiceShortcutButton in my app so a user can easily add or edit a phrase for the shortcut.
Everything works fine on an iPhone: the shortcut shows up at relevant times throughout iOS, and the Intents Extension in my iOS app handles the shortcut when I say the invocation phrase to Siri.
Since 20% of my app’s users use the Apple Watch app, I want to provide a congruent experience on watchOS. The donated shortcut shows up on the Siri watch face, as expected. I trigger the shortcut from the Siri watch face, and is handled by the Intents Extension that's part of my watchOS app.
When I say the intent’s invocation phrase to my Apple Watch (Series 3 GPS-only), however, it doesn’t work. Siri says:
Checking with the app...
Then a few seconds later:
I do not recognize that command.
I’ve tried this with a separate Intents Extension for my watchOS app, and without. I get the same results in both situations. It works on the simulator, but not on a real device.
I’ve also made sure I have my Watch Extension and Watch App selected under Target Membership for the .intentdefinition file.
I’ve also tried going into Settings > Developer and enabling Display Recent Shortcuts then tapping Force Sync Shortcuts to Watch, but that doesn’t change the behavior.
Are voice shortcuts for these custom intents even supported on Apple Watch? I haven’t been able to tell one way or another with Apple’s documentation. The SoupChef sample project is set up with an Intents Extension for the watchOS app, which makes me think it should be supported. And, since it works on the simulator, that makes me think it should be supported.
However, this page doesn’t list custom intents as being supported on watchOS, so that makes me think they may not be supported: https://developer.apple.com/design/human-interface-guidelines/watchos/user-interaction/siri/
If anyone can help me figure out whether this is supported I’d really appreciate it. I’m not sure if I’m doing something wrong or if this just isn’t supported.
The problem was on my Apple Watch.
I was able to get it working by erasing the watch (Settings > General > Reset > Erase All Content and Settings) then restoring it from a backup.
I am trying to create different schemes in Xcode for the Watchkit app - one for Notification and one for Glance.
When I duplicate the Watchkit scheme, and then go to "Edit scheme", to change the Executable in the Run tab, there is only the main executable there, and not the one I just duplicated.
I tryed everything.
Any ideas?
In the latest beta of Xcode 6.2 WatchKit automatically creates the Schemes for Glance and Notification.
In the Edit Scheme Window, click on the Run icon in the left panel. Next, look to the right panel and where it says "Watch Interface", click on the word "Main" and change to the appropriate option.
You have select watchkitInterface and you will see static, dynamic notification and glance in that.
Xcode Schemes manage build targets. Apple Watch Notifications and Glances are not created as separate targets.
They are designed with Glance Interface Controller and Notification Interface Controller objects on your Storyboard within your WatchKit app, and supported with code in your WatchKit App Extension (and potentially elsewhere, for the source of notifications).
Therefore, they cannot be managed with a build scheme. May be useful to review what you were you trying to achieve functionally with this action. There may be another way to achieve it. If, for instance, you want to have just a Glance or Notification interface without having a WatchKit App, you simply create a Storyboard in your WatchKit App that only includes Glance and/or Notification Interface controllers, and not a standard WKInterfaceController. The Apple Watch will do the rest.