I am using "react-native-siri-shortcut' library to make shortcuts.
suggestedInvocationPhrase for my shortcut is "It's Tea Time" so when the user says "Hey Siri, It's Tea Time" then Siri opens the app and gives the whole shortcut object via addShortcutListener, but this listener only works when the app is in foreground or background.
This listener is not working when the app is completely closed.
So now what I want is to make an one shortcut that work's without opening the app. I just want to call a single API whenever the user say "Hey Siri, It's Tea Time" and once the API called Siri have to say back "Your order was placed successfully..." (I want all this process without opening the app).
here are some reference:
https://medium.com/simform-engineering/how-to-integrate-siri-shortcuts-and-design-custom-intents-tutorial-e53285b550cf
https://github.com/Gustash/react-native-siri-shortcut/issues/87
Related
I try to open a specific screen of my app through Siri.
I'm done with CustomIntent and Siri shortcuts. But I expect that users do not need to do anything(do not need to add shortcuts to Siri), they still tell Siri "Hey Siri, do xxx in myApp" and myApp will open the specific screen.
How to handle this?
I want to add my app in the contact info in the address book for messaging, video calls.
This functionality can be achieve using CallKit, in short CallKit provides native phone app UI to all the VoIP application, to let your app visible in the contact (after integrating the CallKit), you just need to smoothly long press the audio/video call buttons.
By default It shows the most frequent used app (say WhatsApp), once you'll long press the icons it'll show a list of the supporting apps (VoIP enable apps). From where you can choose the app to perform the action.
The screenshots will make you more sense to figure it out.
Image 1 - is the default situation I.e. default call and video option.
Image 2 - Long press the call option, It’ll show all the apps which are capable to make audio call.
Image 3 - Same for the video option.
Image 4 - Once you’ll use any app (suppose WhatsApp) the default icon will change to WhatsApp and in the list it’ll start showing WhatsApp and other concern apps.
Source: #1 Ray Wenderlich Toutorial , #2 Sample Code of CallKit Objective-C & Swift both
Note: - In the list below it’ll start showing the apps name once you use any app to make call. And it’ll remain listed even if you uninstall that particular app.
I assume you are using CallKit. So adding .phoneNumber to supportedHandleTypes gives this ability that you can call number via your application.
.generic also gives ability you can start call from history that made or received via your application.
let config = CXProviderConfiguration(localizedName: "anyname you want")
config.supportedHandleTypes = [.phoneNumber,.generic]
According to Intents and thanks to this thread, I know that you can open your app via Siri with "Open [APP NAME]",
What I want to know is if it is possible to tell to Siri just only one word like 'Cheese' to open the Camera app or an other specific keyword set beforehand to open your own app using Siri.
Is it possible ? If yes, I have to use Intents to do that or there is another way ?
Siri runs on the OS level, so in order to use any intents you have set within your app, the user must specify your app.
"Get a ride with Lyft" or "Message Mom in Facebook" etc..
More examples in the doc:
https://developer.apple.com/sirikit/
You can use shortcuts app which comes inbuilt in all iOS devices, for knowing more about Siri Shortcuts refer below links.
https://developer.apple.com/documentation/sirikit/adding_user_interactivity_with_siri_shortcuts_and_the_shortcuts_app
https://www.pocket-lint.com/phones/news/apple/144718-what-is-siri-shortcuts-and-how-does-it-work
When I say "Translate English to Spanish" Siri opens the app Google Translate.
How does Siri know to launch this app and is it possible to register your app for certain keywords with Siri?
Usually you can open an app telling Siri something like:
"Open [APP NAME]"
My guess
In your case I guess Siri is not interpreting the sentence. When you say Translate English to Spanish Siri does try to understand what action should take and since no action with an hight Matching Rate is found then Siri tries to open the App having a name equals to the first word of your sentence.
Test 1
In Italian language the app is named Traduttore. When I say Traduci dall'italiano all'inglese (Translate English to Spanish) Siri does NOT open the translator because Traduttore does not match Traduci.
Test 2
If I say: Musica dall'italiano all'inglese (Music italian to english) which is not a real command, Siri does open the Music app.
Siri and third parties apps
Right now the interaction between Siri and third parties apps is pretty limited, however maybe in the future Apple will provide the tools for a deeper interaction.
Maybe something like what is happening with HomeKit where Apple created an interface to make Siri and Home Devices to talk each other.
You should look at Siri's custom vocabulary.
At the moment it is limited to your App's name and Apple specified domains e.g. Workouts or Ride Booking
But if you're lucky enough that your application falls within those categories you can map some more app specific terminology.
For example, if you had a rock climbing application, Ascent, you could start with a voice command similar to "Hey Siri, start climb" rather than "Hey Siri, start workout with Ascent"
All of your localized vocab choices should be placed into their appropriate language-specific project directories (.lproj).
I need to use the in app purchase server model, where I want the user to buy the the new interactive storybooks for kids and play the book.
I have searched through the net, but was off the luck.
just like -- http://itunes.apple.com/in/app/playtales-kids-interactive/id389523239?mt=8
How to get this work. please help
Thanks a ton.
You can't "install another app" programmatically. What you can do is to open the URL of your second app in iTunes from your application with UIApplication openURL. When you invoke this method with a link in iTunes, the App Store application will automatically open with the information page of your second application. Here the user can purchase it with a simple click.
On the other hand, the link you posted above does not use this approach but downloads/enables some new feature (a new e-book) in the application that was hidden before. I.e. all books were already in the application at the time of download, only they were hidden, or it downloads them from a server via a custom protocol defined by the application.