Handle requests for your app’s services from users using Siri or Maps.

SiriKit Documentation

Posts under SiriKit tag

70 Posts
Sort by:
Post not yet marked as solved
1 Replies
360 Views
Hello I created a simple SwiftUI app with Core Data and I want to be able to add data via the shortcuts app, I created a shortcut that takes some text as input and returns it in uppercase and when I run the shortcut in the shortcuts app, it works, however when I added an "add" function (to save data in the Core Data database) to the intent handle function, and I run it again nothing is saved in the app, here is the code: class MakeUppercaseIntentHandler: NSObject, MakeUppercaseIntentHandling { let persistenceController = PersistenceController() func handle(intent: MakeUppercaseIntent, completion: @escaping (MakeUppercaseIntentResponse) -> Void) { if let inputText = intent.text { let uppercaseText = inputText.uppercased() completion(MakeUppercaseIntentResponse.success(result: add(text: uppercaseText))) } else { completion(MakeUppercaseIntentResponse.failure(error: "The text entred is invalid")) } } func resolveText(for intent: MakeUppercaseIntent, with completion: @escaping (MakeUppercaseTextResolutionResult) -> Void) { if let text = intent.text, !text.isEmpty { completion(MakeUppercaseTextResolutionResult.success(with: text)) } else { completion(MakeUppercaseTextResolutionResult.unsupported(forReason: .noText)) } } func add(text: String) -> String{ let newItem = Item(context: persistenceController.container.viewContext) newItem.text = text do { try persistenceController.container.viewContext.save() } catch { let nsError = error as NSError fatalError("Unresolved error \(nsError), \(nsError.userInfo)") } return text } } Thank You
Posted
by Jad-T.
Last updated
.
Post not yet marked as solved
1 Replies
299 Views
Hi, I'm fairly new to app development and I've stumbled upon an issue with an app I have created and deployed to the App Store already. The issue: The app has a widget that uses Siri Intents with configurable parameters. It allows the user to choose an option from a list that is dynamically generated. On the App Store version the user is not allowed to choose, however in the simulator everything works fine. What would be the issue? Many thanks! Cristian Lăpușan
Posted Last updated
.
Post not yet marked as solved
0 Replies
250 Views
Firstly I'm talking about the new iOS15 feature Focus, replacing Do Not Disturb. I could only find APIs for getting it on iOS locally but I'd like a solution that's cross-platform. It uses iCloud to sync the Focus between devices (Like iPhone and Mac), so I'm wondering if there's a way to get the user's currently set Focus at whatever is synced at their iCloud. Or even setting an intent to get Focus update events. My app is web-based so it's unnecessary to have an iPhone app just for Focus access. Any help would be lovely!
Posted
by laralove.
Last updated
.
Post not yet marked as solved
0 Replies
214 Views
I have a live music app to play live recordings from artists like the Grateful Dead and I'd like to add SiriKit support to it. When users refer to "albums" in my app, they would likely say "show", "recording", or "concert". I've been testing INPlayMediaIntent and when I say "Play an album by the Grateful Dead in Live Music Archive", Siri returns the proper INMediaSearch with mediaType = album and artistName = Grateful Dead. When I say "Play a show/recording by the Grateful Dead in Live Music Archive", Siri sets the mediaName = "Grateful Dead" and nothing else. concert is a bit better, but still not very useful. Is it possible to configure synonyms for "album" so when Siri parses the speech, "show" / "concert" / "recording" will all resolve to "album"?
Posted
by jbuckner.
Last updated
.
Post not yet marked as solved
0 Replies
261 Views
I have a SiriKit extension in my iOS app that uses the INSearchForAccountsIntent to display account balances via the Siri interface.When the user clicks one of the accounts in the list, Siri will automatically show the account detail screen.Can we block user from going into the detail screen by code?
Posted
by Kush997.
Last updated
.
Post marked as Apple Recommended
342 Views
Currently, Apple documentation states that INSearchCallHistory intent is one of the required intents needed for CarPlay to be supported for the app. Sources for that are: This WWDC video ~13:27 timestamp https://developer.apple.com/videos/play/wwdc2017/719 The CarPlay App Programming Guide, page 6 at the top https://developer.apple.com/carplay/documentation/CarPlay-App-Programming-Guide.pdf However, the INSearchCallHistoryIntent is currently deprecated with a notice that it's going to be removed: https://developer.apple.com/documentation/sirikit/insearchcallhistoryintenthandling I don't particularly want to do work that's just going to have to be removed later on. Is this still a requirement for CarPlay? Is there an updated list of required intents needed to support CarPlay?
Posted Last updated
.
Post marked as solved
1 Replies
404 Views
Hello, I am new to Sirikit and I am struggling to accomplish something which seems simple. I need to capture in my app a note from the user using Siri without Siri asking any questions and the application in the background, and after the note is saved in the application Siri needs to say Recorded. I used the system intent INCreateNoteIntent and it works fine as expected but the the initiation phrase that the user needs to say "Create a note on " isn't friendly enough to the user. I would like the user just say "Record" and the after that. Is it possible? I tried also custom intents without any success. Any help will be greatly appreciated.
Posted
by AlbaX.
Last updated
.
Post not yet marked as solved
2 Replies
397 Views
I have downloaded wwdc20-10073 Recipe Assistant project to play with it because I need to solve with Siri a similar business problem but the program doesn't work. I ran it with the default scheme Siri Intent Query (show directions for recepe on Recepe Assistant). I get an error from Siri "I can't get directions using Recipe Assistant. Sorry about that." Can you please help what I am doing wrong. I run the project in Xcode 13 and macOS Monterey 12.0.1
Posted
by AlbaX.
Last updated
.
Post not yet marked as solved
1 Replies
545 Views
Hi all, I am using a UIViewControllerRepresentable that wraps the INUIAddVoiceShortcutButton and presents the INUIAddVoiceShortcutViewController for the user to be able to add my shortcut to Siri. In the past I remember the interaction involved recording a voice trigger (sample article with reference screenshots, https://bit.ly/3ee1Avf However iOS14 seems to have removed this interaction and wants to add the shortcut straight to Siri? Can someone confirm that this is true and there no longer a way to trigger recording the voice prompt? My usecase might be a little more unique where we are building apps for an ingdigenous language program in Australia and we want Siri to trigger on What' Wiradjuri for ... which obviously is not an English word. Thanks for any points and appreciate you sparing your time to read/respond.
Posted
by devraj.
Last updated
.
Post not yet marked as solved
0 Replies
524 Views
I’ve faced the following issue, and shortly the notification picture does not show up with iOS 15 under some conditions. It seems that during INImage processing for INSendMessageIntent, it tries to generate an internal URL with intents-remote-image-proxy if the given source is not a remote URL. But proper URL doesn’t seem to be generated in some cases and the expected image doesn’t show up.  Here the weirdest part for me is that the problem only happens when I release my app (for example to the TestFlight), and with the XCode debug build my implementation works perfectly. [This is the error trace when I release the app] default 16:29:26.149259+0900 NotificationExt Persisting INImage for Intent Type 'INSendMessageIntent': sender image _uri: (null) default 16:29:26.149777+0900 NotificationExt Persisting INImage for Intent Type 'INSendMessageIntent': url created from image's _identifier default 16:29:26.149823+0900 NotificationExt Persisting INImage for Intent Type 'INSendMessageIntent': contentURL scheme does not match scheme 'intents-remote-image-proxy'. Attempting to get a corresponding url with 'intents-remote-image-proxy' scheme. contentURL: 'B4BBA163-2F98-AFCC-8A8D-1178AC8399B5' default 16:29:26.149869+0900 NotificationExt Persisting INImage for Intent Type 'INSendMessageIntent': Getting proxied image synchronously for content url 'B4BBA163-2F98-AFCC-8A8D-1178AC8399B5'. *** error 16:29:26.150077+0900 NotificationExt -[INImageServiceConnection synchronousServiceProxyWithErrorHandler:]_block_invoke Error (from connection <private>; pid: 0) when using image service: Error Domain=NSCocoaErrorDomain Code=4099 UserInfo={NSDebugDescription=<private>} *** error 16:29:26.150238+0900 NotificationExt Persisting INImage for Intent Type 'INSendMessageIntent': Error getting proxied image synchronously for content url 'B4BBA163-2F98-AFCC-8A8D-1178AC8399B5' error: Couldn’t communicate with a helper application. default 16:29:26.150280+0900 NotificationExt Persisting INImage for Intent Type 'INSendMessageIntent': Final contentURL 'B4BBA163-2F98-AFCC-8A8D-1178AC8399B5' to persist. Finished in: 0.000854 seconds With XCode debug build, it works perfectly with generating the proper URL with 'intents-remote-image-proxy' scheme. [This is the trace of the successful case with XCode debug build] default 18:37:38.366065+0900 NotificationExt Persisting INImage for Intent Type 'INSendMessageIntent': sender image _uri: (null) default 18:37:38.366822+0900 NotificationExt Persisting INImage for Intent Type 'INSendMessageIntent': url created from image's _identifier default 18:37:38.366879+0900 NotificationExt Persisting INImage for Intent Type 'INSendMessageIntent': contentURL scheme does not match scheme 'intents-remote-image-proxy'. Attempting to get a corresponding url with 'intents-remote-image-proxy' scheme. contentURL: 'F9EFABF4-3A8F-174A-65E3-BD5B2EBEB2AF' default 18:37:38.366920+0900 NotificationExt Persisting INImage for Intent Type 'INSendMessageIntent': Getting proxied image synchronously for content url 'F9EFABF4-3A8F-174A-65E3-BD5B2EBEB2AF'. default 18:37:38.367166+0900 NotificationExt Persisting INImage for Intent Type 'INSendMessageIntent': Final contentURL 'intents-remote-image-proxy:?proxyIdentifier=F9EFABF4-3A8F-174A-65E3-BD5B2EBEB2AF.png&storageServiceIdentifier=com.apple.Intents.INImageServiceConnection' to persist. Finished in: 0.000929 seconds Here is the part of my code snippet. let friendImg = INImage(imageData: img.jpegData(compressionQuality: 0.1)!)         let senderPerson = INPerson(             personHandle: INPersonHandle(value: nil, type: .unknown),             nameComponents: nil,             displayName: “test”,             image: friendImg,             contactIdentifier: nil,             customIdentifier: nil,             isMe: false,             suggestionType: .none         )         let intent = INSendMessageIntent(             recipients: nil,             outgoingMessageType: .outgoingMessageText,             content: nil,             speakableGroupName: INSpeakableString(spokenPhrase: “test”),             conversationIdentifier: nil,             serviceName: nil,             sender: senderPerson,             attachments: nil         )                  intent.setImage(friendImg, forParameterNamed: \.sender)                  let interaction = INInteraction(intent: intent, response: nil)         interaction.direction = .incoming         interaction.donate(completion: nil)                 do {                 content = try content.updating(from: intent) as! UNMutableNotificationContent             } catch {                 //…             } } Plus, I’ve added NSExtension → NSExtensionAttributes (dictionary) → IntentsSupported (array) → INSendMessageIntent (string) in Notification Service Extension's Info.plist I’ve Enabled the Communication Notifications capability on my main app target Any Idea on this issue? Is there anything suspected?
Posted
by montre.
Last updated
.
Post not yet marked as solved
1 Replies
399 Views
Hi, I haven't been able to add some basic SiriKit actions to my macOS app in macOS Monterey. To test this out, I created a new project, made it a macOS app with Storyboard. Then I added an intents definition file, and added a basic intent, with no inputs/outputs. I added the intent name to "Supported Intents" in the target "General" configuration. Now when I build and run the app, the shortcut doesn't show up in the Apple Shortcuts app. I've tried looking for the "Siri" capability in "Signing & Capabilities" and it's not listed there (compared to a new iOS app where it would be). I'm not sure what I'm missing here. Would love some help. I'm using Xcode 13.1 on macOS Monterey RC.
Posted
by zulfishah.
Last updated
.
Post not yet marked as solved
0 Replies
184 Views
There is a common pattern used by Apple applications to get the properties of a custom type. "Get Details of Calendar Events" or "Get Details of Contacts" are examples of what I'm talking about. It seems like these actions return different response types depending on the property that gets selected as the "detail" to get. I can't figure out how to do this in the Intent definition in Xcode. Is this is a limitation of the current Intent definition file or is there some trick to implementing this pattern?
Posted Last updated
.
Post not yet marked as solved
1 Replies
445 Views
I want to use Siri to perform a repetitive task in my app that inputs variable parameters, thus accelerating the input of that data. I have implemented a couple custom intents for background execution with the use of an intentDefinition file and implemented an IntentsExtension and associated plist to enable those custom intents. I can successfully donate an interaction that iOS matches with the supported suggestions in the intentsDefinition file that causes a Siri Suggestion to be displayed in Siri Search (or on the lock screen when enabled): CreatePartsListIntent* createPartsListIntent = [[CreatePartsListIntent alloc] init];     createPartsListIntent.projectName = intentData.projectName;     createPartsListIntent.quantity = intentData.quantity; INInteraction* interaction = [[INInteraction alloc] initWithIntent:createPartsListIntent response:nil];     [interaction donateInteractionWithCompletion:^(NSError * _Nullable error) {         if(!error) {             NSLog(@"CreatePartsList donation success");         }else {             NSLog(@"CreatePartsList donation fail %@",error.localizedDescription);         }     }]; I can then tap on this suggestion and it takes me to my appDelegate to process the interaction within the app - (id)application:(UIApplication *)application handlerForIntent:(INIntent *)intent { // This method is called when I tap on the Siri suggestion } But I want to process the interaction in the background using voice commands. When I speak the the command of the interaction I donated, the IntentHandler is never called. I cannot figure out what I need to do to get the IntentHandler to be called. According to the WWDC18 Intro to Siri Shortcuts, I should be able to invoke a dialog with Siri, which is my goal. Am I off track. Why isn't the IntentHandler being called? What should trigger it to be called?
Posted
by jeffb6688.
Last updated
.
Post not yet marked as solved
1 Replies
307 Views
Assuming I have a messaging app called "ExampleMessenger" with many users (e.g. Jack) who also have the app installed I would like to tell my iPhone, via Sirikit (or any other way) something like the following: "Send ExampleMessenger a message telling Jack that I am back in the office" Can Sirikit be used to send this message? If so, where is the message parsed into "Jack" and "I am back in the office"? In the Sirikit Intents code? Or in the app itself via a separate function?
Posted
by david_eye.
Last updated
.
Post not yet marked as solved
0 Replies
717 Views
2021-10-15 12:26:06.427879+0800 CodeNotificationExtension[17524:630750] [default] LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=264, _LSFunction=-[_LSDReadClient getServerStoreWithCompletionHandler:]} 2021-10-15 12:26:06.428337+0800 CodeNotificationExtension[17524:630750] [default] Attempt to map database failed: permission was denied. This attempt will not be retried. 2021-10-15 12:26:06.428386+0800 CodeNotificationExtension[17524:630750] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=264, _LSFunction=-[_LSDReadClient getServerStoreWithCompletionHandler:]} 2021-10-15 12:26:06.428445+0800 CodeNotificationExtension[17524:630750] [Intents] +[INAppInfo appInfoWithAppProxy:] Unable to create app info with application record: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=264, _LSFunction=-[_LSDReadClient getServerStoreWithCompletionHandler:]}
Posted Last updated
.
Post not yet marked as solved
1 Replies
380 Views
I am attempting to donate an Interaction for a custom intent to create a Siri Shortcut. This is resulting in an execution error as follows: . . . *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<__NSCFString 0x2837703c0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key pronunciationHint.' terminating with uncaught exception of type NSException This error occurs with the invocation of the following code block: `CreatePartsListIntent* createPartsListIntent = [[CreatePartsListIntent alloc] init];          createPartsListIntent.nameOfProject = intentData.nameOfProject;     createPartsListIntent.quantity = intentData.quantity;     INInteraction* interaction = [[INInteraction alloc] initWithIntent:createPartsListIntent response:nil];     [interaction donateInteractionWithCompletion:^(NSError * _Nullable error) {         if(!error) {             NSLog(@"CreatePartsList donation success");         }else {             NSLog(@"CreatePartsList donation fail %@",error.localizedDescription);         }     }];` I did a search for pronunciationHint. I found this in my intents.intentsDefinition file. It is a hidden parameter, but can be found when you open the file as propertyList. It is at the end of the file under INTypes. Below is a screenshot of the INTypes content found at the end of the intents.intentsDefinition file. If I delete Item 2 and Item 3 and delete the DerivedData, I still get the same NSException error, so I don't know where it is finding pronunciationHint and why it even cares that it is there. I am not even sure why the pronunciationHint parameter is being created. An excerpt of my intentDefinition file is shown below where it is showing the parameter TYPE that I created called Project. The auto creation of pronunciationHint is apparently related to the creation of this Project TYPE: Any ideas on how I can get by this error?
Posted
by jeffb6688.
Last updated
.
Post not yet marked as solved
0 Replies
247 Views
I just noticed that siri custom intents are not resolving correctly for DURATION type parameters. Siri keeps providing the default value even after the user speaks. This happens on the new IOS 15 devices. See my code snippet     guard let duration = intent.parkingTime else{       completion(INTimeIntervalResolutionResult.needsValue())       return     }      /* Siri keeps returning 0 even if the user says 100 */     if(intent.parkingTime?.doubleValue == 0){       completion(INTimeIntervalResolutionResult.needsValue())       return     }     print("PARKING TIME \(duration.doubleValue)")           completion(INTimeIntervalResolutionResult.success(with: TimeInterval(duration.doubleValue)))   }
Posted
by babafresh.
Last updated
.
Post not yet marked as solved
0 Replies
299 Views
Hello, is there a way to create an iOS library (potentially a Cocoa Pod or a Swift Package) with a SiriKit custom intent to be used as a way to enhance any application with that library installed?
Posted
by pampanet.
Last updated
.
Post not yet marked as solved
4 Replies
2k Views
Hello, i got this mail after upload my binary. /* Dear Developer, We identified one or more issues with a recent delivery for your app. Your delivery was successful, but you may wish to correct the following issues in your next delivery: ITMS-90626: Invalid Siri Support - Localized title for custom intent: 'Configuration' not found for locale: pl ITMS-90626: Invalid Siri Support - Localized title for custom intent: 'Configuration' not found for locale: es ITMS-90626: Invalid Siri Support - Localized title for custom intent: 'Configuration' not found for locale: da ITMS-90626: Invalid Siri Support - Localized title for custom intent: 'Configuration' not found for locale: ru ITMS-90626: Invalid Siri Support - Localized title for custom intent: 'Configuration' not found for locale: tr ITMS-90626: Invalid Siri Support - Localized title for custom intent: 'Configuration' not found for locale: el ITMS-90626: Invalid Siri Support - Localized title for custom intent: 'Configuration' not found for locale: nl ITMS-90626: Invalid Siri Support - Localized description for custom intent: 'Configuration' not found for locale: en ITMS-90626: Invalid Siri Support - Localized title for custom intent: 'Configuration' not found for locale: fr ITMS-90626: Invalid Siri Support - Localized title for custom intent: 'Configuration' not found for locale: nb ITMS-90626: Invalid Siri Support - Localized title for custom intent: 'Configuration' not found for locale: pt ITMS-90626: Invalid Siri Support - Localized title for custom intent: 'Configuration' not found for locale: sv ITMS-90626: Invalid Siri Support - Localized title for custom intent: 'Configuration' not found for locale: de ITMS-90626: Invalid Siri Support - Localized title for custom intent: 'Configuration' not found for locale: cs ITMS-90626: Invalid Siri Support - Localized title for custom intent: 'Configuration' not found for locale: it After you’ve corrected the issues, you can upload a new binary to App Store Connect. Best regards, The App Store Team / My App SiriKit Intent has only de and en localization files. The en and de localization strings are fully filled. What's the problem ???
Posted
by JBleyel.
Last updated
.