How to open a specific view controller from a command to Siri? - ios

For example:
if I give command to Siri "Show me my purchase history in [MyApp]"
action should be a segue to that particular view controller in my app.
I have designed an app named CodeX (A handy compiler), I want to add Siri support in version 2 with above capabilities.

SiriKit currently is limited to specific category of service (known as a domain), like fitness, messaging, and payments and can perform certain actions related to these domains only. Your app can integrate with Siri if your action fits in the current supported Domains and Intents. I don't think you can perform the segue since it's not a directly supported action.

Related

How to customise SiriKit intent extension for shortcuts app to ask allow access?

We are allowed to build custom intent for Siri, by extending SiriKit.
Moreover, Apples present how to manage basic integrations and customizations to Siri Shortcuts and Shortcuts app
Link for shortcuts app
Nonetheless, some apps have their own shortcuts UI with a little customization; for instance with the button to allow access for API, how can we do that?
In the documentation presented by Apple, there is no such instruction for how is it possible to customize the UI inside the shortcuts app regarding the custom intent created by my app.
I tried to make custom failure for the Intent response but didn't find the option for API access. Like ↴
However nothing quite similar to the UI presented by Shortcuts App, while attempt to first run trello ↴
These actions are provided by the Shortcuts app itself rather than by Siri intents exposed by another app. Indeed, these actions don’t even need the Trello or Wunderlist apps installed.
This means that Shortcuts can present a different UI.
The UI that it will show for your app is defined by the parameters in your intents file.
You can’t create the same experience for your app, however the user can perform any required authorisation in your app itself and it is reasonable to expect that they have run your app before trying to set up shortcuts that use it.

How to integrate Siri with an iOS app to allow voice search

How can I integrate Siri with a custom iOS app to allow users to search for keywords using their voices? For example the user speaks a keyword and activate the app to search for the result. Or searching specific information with a sentence.
There are basically two main ways to interact with SiriKit:
NSUserActivity, a basic action in your app.
INIntent, allows you to interact with Siri.
You have to choose which one fits you purpose. If you need user input (like a search term) from Siri you probably want to use an INIntent (available in iOS 13+) which then completes with a userActivity with the data you need. That should call the application:continueUserActivity:restorationHandler function in your AppDelegate.
The user can choose to add those features to his SiriShortcuts app himself. You can add a INUIAddVoiceShortcutButton in your app to get the users attention to that feature.

How to make my iOS APP share files directily to another APP like Workflow "Open in" action

Here is the Workflow Action. It seems that Workflow can send a file to another APP directily. Any ideas?
The normal way to send a file to another APP is using Share Extension, but Workflow APP could send it directily without showing the Action Sheet and selecting an APP.
If you set an action like this and run your workflow, it just open the selected APP and that APP got the file.
So I just want to know is there any way to make it happen? Or it just a secret API of iOS and Workflow just use it because of the purchase?
Your exact question needs to be stated more clearly (e.g. exactly WHAT you are trying to accomplish instead of just "integrate"). To get you started, some quick info:
At my last check, Workflow integrates with apps in a few main ways:
1) Via the iOS sharing/share-sheet interface.
2) Built-in support for the app within Workflow itself.
3) (of course, Workflow can also leverage Callback URI's of other apps to integrate with them like any other app can.)
If you want to have direct, built-in support from Workflow, the Workflow team itself must add the support into the Workflow app. This is easier for them (and others) if your app exposes a proper API with functions that allow direct integration.
Going into this further is too broad of a topic for a quick answer. I hope this helps some.

How to push different IntentViewController in Sirikit extension based on the Intent type?

I am trying to integrate Sirikit extension into my existing iOS app.
For this, I am going to use two different types of intent.
INSendMessageIntent - to send message from Siri through my app.
INSendPaymentIntent - for making a payment
For both the intent types, I was to use custom & different IntentUI.
But how to push different ViewController in Sirikit extension for based on the Intent type i.e., if I say Make payment using MyWorld then one PayViewController has to be pushed and when I say Send message using MyWorld then MessageViewController has to be pushed.
I want to choose View controller dynamically at runtime based on the Intent type (i.e., INSendMessageIntent or INSendPaymentIntent).
I think you should be able to support more than one function of Siri by creating independent targets. The payments UI is one IntentsUI target, and the messages UI is another one. Info plists for each define which target looks after which type of intent.

iOS 8: options for presenting Action Extensions to users?

After reading the Apple documentation on extensions, it's not clear how Action Extensions get presented to users. The docs mention the Bing translate use case where actions are presented after users tap the Share button. But what if an app, say a chat app, doesn't have a share button? Another example is if the calling app (not the containing app of the extension) presents an option to invoke an Action Extension.
Are these the only two options? In other words, if an app lacks a Share button and doesn't integrate your extension, there's no way to present an Action Extension?
That is correct. Actions are always initiated by the user, and always from system-provided UI.
Extensions are presented as a possible in a UIActivityViewController. The host app provides the UIActivityViewController with the data context. If your extension adheres to this context, it will be available in the list.
If someone writes an app without the UIActivityViewController then they won't be able to use your extension.
May be help you.
Apple provides sample code for ImageInverter: Creating Action Extensions
There are concept for Action Extensions.

Resources