App Intents

RSS for tag

Extend your app’s custom functionality to support system-level services, like Siri and the Shortcuts app.

App Intents Documentation

Posts under App Intents tag

59 Posts
Sort by:
Post not yet marked as solved
0 Replies
34 Views
I have the following intents: PlayMusic StopMusic NextSound PreviousSound With the following utterances: Play "I'm the one": PlayMusic Play music: PlayMusic Stop the sound: StopMusic Play the Next sound: NextSound Next sound: NextSound Play the previous sound: PreviousSound Previous sound "I'm the one": PreviousSound There are a lot of NLP techniques like Bert (google), Roberta (facebook) etc. who are able to classify those intents. But I couldn't find a framework/technology from Apple, that classifies those intents. Are there technologies from Apple to extend my iOS app?
Posted Last updated
.
Post not yet marked as solved
0 Replies
49 Views
I'm trying to implement an app Shortcut (Custom Intent) for a macOS app on Monterey. Shortcuts.app finds the shortcut, but when I run it, the progress bar goes to 50% and stops. My handler and resolution code is not called. I'm implementing the handling in-app (not in an extension) I'm following instructions from the WWDC 2021 video "Meet Shortcuts for macOS" and this link https://developer.apple.com/documentation/sirikit/adding_user_interactivity_with_siri_shortcuts_and_the_shortcuts_app?language=objc If I filter on "shortcuts" in the Console app, and press the run button in Shortcuts.app for my Shortcut, I see this message (amongst others) -[WFAction processParameterStates:withInput:skippingHiddenParameters:askForValuesIfNecessary:workQueue:completionHandler:]_block_invoke Action <WFHandleCustomIntentAction: 0x15c1305b0, identifier: finished processing parameter states. Values: which looks sort of promising but I also see this Sandbox: Shortcuts(9856) deny(1) file-read-data /Users/stu/Library/Developer/Xcode/DerivedData/-hghdaydxzeamopexvfsgfeuvsejw/Build/Products/Debug/.app I've tried moving my app to /Applications and launching it from there, I see a similar message in the log, but the path leads to the app in /Applications. I've tried deleting all copies of my app aside from the one I'm currently building and debugging. I've tried deleting the derived data folder, restarting the Mac, re-launching the Shortcuts app. I've tried sandboxing my app. Other Shortcuts (for other apps) work on this machine. I'm probably missing something extremely simple - does anyone have a suggestion? Some related questions: At WWDC 2022, Apple introduced "App Intents", without adequately explaining how these differ from the intents described in the WWDC 2021 video. Can anyone tell me what the difference is? In the Xcode editor for the .intentdefinition file, there's a button "Convert to App Intent". Clicking it produces some new Swift files in my app, but the thing is an intent handled by an app, and now it is an App Intent - what's the difference? Is one better than the other? Do I have to click the convert button again if I subsequently modify the .intentdefinition file, or is this conversion process intended to replace the .intentdefinition file with those .swift files?
Posted
by ssmith_c.
Last updated
.
Post not yet marked as solved
2 Replies
302 Views
I setup multiple intents/shortcuts as shown below. I have renamed the shortcuts and omitted the intent code for privacy/security reasons. The code hasn't changed for a few days, and it stopped working. Siri no longer recognizes voiced commands provided in the phrases, when it used to recognize all of them. I have tried deleting the app, disabling Siri/deleting the dictionary, and restarting my phone, but no luck. Nothing can get it working again. Any suggestions or workarounds? I could only find posts where it never worked for some people. I had it working, but it broke. Thanks in advance. import Foundation import AppIntents @available(iOS 16.0, *) struct MyAppShortcuts: AppShortcutsProvider {     static var appShortcuts: [AppShortcut] {         AppShortcut(             intent: ExportAllTransactionsIntent(),             phrases: ["Make a (.applicationName) record", "Make a (.applicationName) *******"])         AppShortcut(             intent: ExportAllTransactionsIntent1(),             phrases: ["Display (.applicationName) ******** codes", "Show (.applicationName)******* *****])         AppShortcut(             intent: ExportAllTransactionsIntent2(),             phrases: ["Display (.applicationName) ********", "Show (.applicationName) *******"])     } }
Posted
by tgpeter07.
Last updated
.
Post not yet marked as solved
0 Replies
69 Views
I'm using the AppIntents framework introduced in iOS 16. My goal is to create an AppIntent that performs a long-running task but does open my app when run. When I run the Intent from the Shortcuts app, I see an error message that says the shortcut "was interrupted because it didn't finish executing in time." Is there a way to signal progress to the user of a long-running AppIntent or get more time from the system prior to the AppIntent being cancelled?
Posted Last updated
.
Post not yet marked as solved
1 Replies
262 Views
Hello, the new AppIntents allow a simple code-driven implementation for Siri Shortcuts. In the perform() function we need to return some IntentResult or throw an error if something went wrong. My question now is: How do I throw an error that can then be inspected by the user? Let's say the user wants to interact with a CoreData object that he has deleted earlier. Now he/she runs the shortcut and it must fail, because the object is not available. I tried to implement a custom LocalizedError, but in the Shortcuts app I only get an error message telling me something about an unknown error. The description text is not shown in Shortcuts. Feedback ID: FB11434135 Kind regards Alex
Posted
by AlexSFD.
Last updated
.
Post not yet marked as solved
0 Replies
75 Views
I'd like to try designing an apple app that has siri control to count up to a set limit via voice control. For example, I could say 'Siri - add 3lb', then a few minutes later, 'Siri-add 6lb'. (which would bring a total to 9lb). Then a bit later say 'Siri- add 2lb' (so would then bring a running total to 11lb) Then add other commands such as 'Siri - what is the total' to then get a total of how much is in the basket and how far I am off the set limit. Or add a warning if a set limit is reached when I add further contents. Or, then add a second basket and start afresh. I just don't know whether this is possible or where to start in the design process as I'm a complete newbie on this kind of thing. What I want to know is where to start. What is the software needed? Is it App-intents, Xcode, Swift etc. Any pointers to where I should start researching first would be appreciated. Thanks, Joe
Posted
by BigJoe99.
Last updated
.
Post not yet marked as solved
7 Replies
860 Views
I'm implementing the iOS 16 AppIntents framework and it works fine except when I try to trigger it with Siri, which just pulls up results from the web. Here's a very simple version I made on an empty project. import Foundation import AppIntents @available(iOS 16.0, *) struct ShowMeBooks: AppIntent {     static var openAppWhenRun: Bool = false     static var title: LocalizedStringResource = "Show me my books"          func perform() async throws -> some IntentPerformResult {         let x = 1 + 1         return .finished(dialog: "Here are your books")     } } @available(iOS 16.0, *) struct SouthwestShortcuts: AppShortcutsProvider {     static var appShortcuts: [AppShortcut] {         AppShortcut(             intent: ShowMeBooks(),             phrases: ["Show me my books on \(.applicationName)"]         )     } }
Posted
by F99.
Last updated
.
Post not yet marked as solved
3 Replies
674 Views
Hi, I tried to implement the new AppIntents to replace some old shortcuts. I followed the sessions and their examples on how they are implemented. Unfortunately, I have not been able to get an App Intent into the Shortcuts App. I tried it on different apps, new projects and tried multiple changes to the intents. Is there something that I'm missing or is this just a bug in Beta 1? Here's my sample code: import AppIntents struct TestIntent: AppIntent {     static var title: LocalizedStringResource = "Test"     static var description: IntentDescription? = IntentDescription("Test description")          func perform() async throws -> some IntentPerformResult {         .finished(value: "Test")     } } I filed a feedback for this issue: FB10102293 All the best, Alex
Posted
by AlexSFD.
Last updated
.
Post not yet marked as solved
1 Replies
222 Views
How to read the physical Action button of the Apple Watch Ultra? I found some partial info that will be a part of StarWorkoutIntent. Does anyone have a working example of how to implement StartWorkoutIntent and integrate it into a fitness app?
Posted
by nastya_kh.
Last updated
.
Post not yet marked as solved
0 Replies
138 Views
CoreBluetooth silently fails under iOS when used from AppIntents extension but works in macOS as an extension or in iOS when AppIntents types are compiled as part of the main app. CBCentralManager will never find any devices despite the state being .poweredOn. CoreBluetooth should not silently fail and return 0 scan results when running in the AppIntents Extension under Siri Shortcuts. Other apps extensions like the original Intents framework, iMessage, Today and QuickLook work fine with CoreBluetooth. I had to discard using the extension and just embed the AppIntents definitions in my app. I would prefer to use the extension as its lightweight for Siri Shortcuts if possible.
Posted Last updated
.
Post not yet marked as solved
0 Replies
130 Views
Recently I was trying to create an app shortcut using App Intents to experience the zero setup feature. The zero setup feature was working fine in Xcode 14 beta simulators but in Xcode 14 release version it is not working. I referred the App Intents documentation, the document says that while developing create the app shortcut from the shortcut app (https://developer.apple.com/documentation/appintents/providing-your-app-s-capabilities-to-system-services). My question is, Does the zero setup feature works when app is published?
Posted Last updated
.
Post not yet marked as solved
1 Replies
155 Views
I'm working on an app for an accompanying toy that allows you do drop a marble on a self made track. As a nice bonus I wanted to make it possible to drop a marble using Siri Shortcuts, Siri or the HomePod. So the new iOS 16 App Intents work great for this. The App Intent documentation is bare, but I got the App Intent to work and it evens shows a custom error message when something goes wrong, However I now want to promote the feature. SiriTipUIView is meant for this, however I'm seeing an issue. The application name is missing from the tips UI, instead the phrase starts with a space. The code for the App Shortcuts struct MyAppShortcutsProvider: AppShortcutsProvider {     static var appShortcuts = [         AppShortcut(intent: DropMarbleIntent(), phrases: [             "\(.applicationName) drop marble",             "\(.applicationName) drop a marble",             "Drop a \(.applicationName)",             "Drop \(.applicationName)"         ])     ] } The code for the SiriTipUIView (just for testing) let tipView = SiriTipUIView() tipView.setIntent(intent: DropMarbleIntent()) tipView.sizeToFitUsingConstraints() tipView.allowsDismissal = true presentedSubscription = tipView.publisher(for: \.isPresented).sink { isPresented in if isPresented == false {     self.tableView.tableHeaderView = nil     } } tableView.tableHeaderView = tipView This happens on any iOS 16 simulator and on an iPhone 13 Pro running the iOS 16 release version. Am I missing something, or should I report a bug using feedback?
Posted
by renssies.
Last updated
.
Post not yet marked as solved
3 Replies
317 Views
Version 14.0 beta 4 (14A5284g) This is all referring to the simulator. When I run the Shortcuts app my phrase is properly shown for my app and the app's name is correctly populated. However, when I try to add a SiriTipView the same phrase shows the application name as ${APPLICATIONNAME}. I changed the first letter of the phrase and verified the change showed up in the Shortcuts app and my app tip. I'm not sure if I'm doing something wrong or should file feedback instead.
Posted Last updated
.
Post marked as solved
1 Replies
127 Views
I am new to using Siri Shortcuts. I can't figure out what I'm doing wrong. I have a custom intent in aSiriKit Intents Definition File. The intent has one parameter. The parameter type is a custom type The custom type has only an identifier and display string. I am trying to set Shortcut Suggestions using my custom intent. I first create the shortcut with the intent. Then suggest it. This is the feedback in the output window. The only place where "combinations" are mentioned is under the "Shortcuts app" and "Suggestions" section in the definitions file. I on'y have one supported combination, which is the vehicleParameter. I would appreciate some guidance on what I'm doing wrong. Thanks
Posted
by MacMMC.
Last updated
.
Post not yet marked as solved
3 Replies
801 Views
I'm trying to test out the new AppIntents API that is currently on iOS16 Beta. Looking at the documentation, the implementation seems pretty straight forward, but after implementing it, I'm not seeing my AppIntent in the Shortcuts app. The device is running iOS 16.0. This is how I implemented the AppIntent: import AppIntents struct DoSomethingIntent: AppIntent { static var title: LocalizedStringResource = "This will do something" static var description = IntentDescription("Does something") func perform() async throws -> some PerformResult { return .finished(value: "Done") } } According to the documentation the Shortcuts app should be able to find my AppIntent after my app gets installed, but I see that's not the case. Does anybody know what my implementation is missing or have I misunderstood the whole thing?
Posted
by Norik.
Last updated
.
Post not yet marked as solved
0 Replies
131 Views
Our App is trying to support Siri suggestion by donating user's activity. And I follow the document to ask for user‘s authorization. https://developer.apple.com/documentation/sirikit/intent_handling_infrastructure/requesting_authorization_to_use_siri In iOS15.5, the alert did prompt as expected; but in iOS 15.4, the alert did not prompt, and the authorization result is default authorized; in iOS 15.0,the alert did not prompt and the authorization result is default denied. I have two questions: 1、using requestSiriAuthorization, and the alert doesn't prompt, does it fit the expectation, or it's a system bug? 2、when our app only uses MediaIntent, do we need ask for Siri authorization?
Posted Last updated
.
Post not yet marked as solved
1 Replies
223 Views
I have created an Intent with openAppWhenRun = true, defined a String? parameter and tried to get a value for it through $myParameter.requestDisambiguation in perform method Then I created Shortcut for my Intent When I call my Shortcut from lockscreen this happens: iPhone asks to unlock I unlock it Application opens Nothing happens In debugger I can see that $myParameter.requestDisambiguation executes but nothing happens then. It seems that my application is awaiting $myParameter.requestDisambiguation forever When running shortcut with iPhone being already unlocked, everything works fine. Application opens and I can see disambiguation dialog. If I remove $myParameter.requestDisambiguation call, everything works fine as well What am I doing wrong? Or maybe it is a bug and there is any workaround? My code snippet: struct SampleIntent: AppIntent {  static var openAppWhenRun: Bool = true  static let title: LocalizedStringResource = "Start sample intent"  @Parameter(title: "Test", description: "Test")  var test: String?  func perform() async throws -> some IntentResult {   let choice = try? await $test.requestDisambiguation(among: ["One", "Two", "Three"])   print("Perform method called")   return .result(dialog: "Done")  } } struct SampleShortcuts: AppShortcutsProvider {  static var appShortcuts: [AppShortcut] = [   AppShortcut(    intent: SampleIntent(),    phrases: [     "Hello \(.applicationName)"    ]   )  ] }
Posted
by romah1.
Last updated
.
Post not yet marked as solved
0 Replies
171 Views
When I go to the Shortcuts app and add an action, there is a tab that lets me see Apps that has actions I can use. How do I make my iOS app be able to contribute actions for users to use in a shortcut, so that a user creating a shortcut can add an action that does something in my app? An example of this is the Walmart app. A user can create use an action that allows him to check in.
Posted Last updated
.
Post not yet marked as solved
3 Replies
482 Views
App shortcuts can only be added to Shortcut Action List, but not a separate App Shortcuts appears at the bottom of the Shortcuts app. Now it only has the default Voice Memo App. It successfully appeared in beta 2/3, but I'm not sure if it appeared in (beta 3 update). But in beta 4, it disappeared. I have no idea how to make it visible again!!!
Posted Last updated
.
Post not yet marked as solved
0 Replies
139 Views
My app is mostly implemented in UIKit. Will AppIntents work with UIKit? If so, which (scene or app) delegate method gets called to start the intent?
Posted
by Phantom59.
Last updated
.