How can I tell if my intent is running in the Shortcuts app?

Paulw11

In my app I have created a SiriKit intent that allows the user to search for people.

If they trigger this intent directly from Siri then I would like to open my app with this search string and show the results - I can do this by passing .continueInApp and an NSUserActivity to the completion handler.

However, if the intent is part of a flow in the Shortcuts app then I want to pass the results as an output from the intent handler - Again, I can do this by returning an array of results and .success to the completion handler.

My question is how can my handler determine the context in which it is running, so that it either launches my app or returns the result directly as is appropriate?

Alex

I may be wrong, but I don't think iOS exposes such information (originator, e.g. Siri or ShortCuts), as this would allow developers to define app behaviours that are different from the static definitions of their Intents (in which Siri/ShortCuts are supposed to act transparently). I doubt Apple would ever agree to that.

IMO, if this is really what you want, the only option is to take a stack trace, identify if/where the calling function exhibits differences between Siri/ShortCuts are, and work it from there.

Ugly, but it'll work.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I tell if my Android app is running in Google Cloud Test Lab?

How can I tell if my promise.all is running in parallel?

How can I tell my method to ignore an exception and continue running?

How can I tell if my ipfs daemon is running the background?

How can I tell if my batch file is running?

How can I tell if Elastic Beanstalk is running my config files?

How can I tell my app to ignore a specific touch?

How can I tell my app was started as a result of background refresh?

How can I tell if handleOpenURL is called app startup or while app is running?

How do I tell what version of IIS and Windows my Azure App Service is running on

How can I tell if my Cordova application is running on a simulator or real device?

How can I tell whether my Django application is running on development server or not?

How can I tell my laptop to shutodwn after finishing running a non-root process

How can I get prometheus exporters running in my grails app?

How can I detect, that my app is running on the Ripple Emulator?

How can I detect if my app is running on Windows 10

How can I programmatically determine if my app is running in the iphone simulator?

How can I detect if my Flutter app is running in the web?

How can I use Siri Shortcuts to show a specific page in my app?

how i can intent any social media app to my app not just email

How can I tell if my interface{} is a pointer?

Running `VBoxManage startvm ...`: how can I tell when the VM is running?

How can I tell if my app upgrade from angular 2 to angular 4 was successful?

How can I tell Vue-cli where my app's entrypoint is?

How can my app open Siri shortcuts recording phrase view

How can you tell when a Kafka Streams app is in the "running" state?

How do I tell if my container is running inside a Kubernetes cluster?

How can I open my SwiftUI app and perform a function using NSUseractivity from within Siri Intent Extension?

How can I tell which application I'm running in Spark?