Bharath Bharath - 1 month ago 20
iOS Question

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
).

Answer

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.