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?