Anyone gotten SiriKit and INIntent working yet?

Ttying to get SiriKit working. Tried the sample payment app, compile and running in iOS 10. Can't seem to be able to trigger it with Siri.

Also tried to add an Intent extension to an existing app of mine. Siri just keeps telling me that I need to launch the app to do that.


Has anyone gotten this to work yet?

From the release notes:

Functionality that requires adoption from App Store apps, such as iMessage apps, SiriKit, and Maps extensions, will not be available until those apps are able to adopt and submit to the Store

Just create a new "Intents Extension" target, change the types of Intents you want to handle inside the Info.plist, implements the right *IntentHandling protocol, and you're on. I just managed to make this work.

That's what I did.


And if I create the Intent Extension without any modifications, it has the correct IntentHandling implemented.

Can you give an example what type of intent you created, and the speech you used to trigger it?

Make sure to request Siri authorization in your main app's plist using NSSiriUsageDescription and the following code:


    [INPreferences requestSiriAuthorization:^(INSiriAuthorizationStatus status) {
        if (status == INSiriAuthorizationStatusAuthorized)
        {
            [[INVocabulary sharedVocabulary] setVocabularyStrings:[NSOrderedSet orderedSetWithArray:workoutModelNames] ofType:INVocabularyStringTypeWorkoutActivityName];
        }
    }];

Go to Settings > Siri > Scroll down to bottom at APPS section, find your app and make sure Siri is enabled for your app.

You have to set the appropriate capability in the app's entitlements as well.

I made it work but there is still a problem with setVocabularyStrings of INVocabulary. It looks like contacts added with that method won't be passed to INSendPaymentIntentHandling.resolvePayee (payment app). Except from this issue (wating for a fix from Apple right now...) it looks ok. The steps to do are:



1) Create an app extension to manage Siri calls in your project

2) Add Siri Kit capability to the App (fron XCode 8)

3) Add Siri app extension to your app (XCode Wizard)

4) Add the required attributes to the info.plist of the extension for Siri support (see Apple documentation on NSExtension)

5) Add NSSiriUsageDescription in your app info.plist (see Apple online documentation)

6) Add NSExtensionPrincipalClass (see apple documentation) to your app extension info.plist file. It must point to your Intent handling class implementation iside the extension

7) Implement the required extension's protocol



You can find a few examples online.



After that your app should be able to integrate Siri. Another story is to add new items in the Vocabulary. I'll tell you what to do with that after Apple will answer me.



UPDATE

There is another glitch. Even if you ask Siri to make a payment in a foreign currency (Euro for example), Siri will initially understand you are requiring a foreign currency payment... but then she will ask you on screen confirmation for a payment in US dollars, no matter which currency you initially dictated. That is, she will understand you are payng with another currency, but in the end she will revert to USD when it is time to complete the payment.

> It looks like contacts added with that method won't be passed to INSendPaymentIntentHandling.resolvePayee (payment app).


We are seeing something similiar. What we are seeing is that if we add Sue Smith as a contact using Custom Vocabulary in main app, if you say to Siri "PAY SUE SMITH one hunded dollars for babysitting using [appname]", only SUE gets passed to resolvePayee. This will obviously cause issues if you have 2 people named Sue in your vocab list and Siri prompts for disambiguation when it doesn't need to.


I opened a Radar on this (28548798) on 9/29 and I would encourage you to do so as well. This worked in the early iOS 10 betas, but broke around beta 3 or 4 I think. I was busy working on another project and never got around to researching the issue and reporting it until iOS 10 GM was out.


> if you ask Siri to make a payment in a foreign currency (Euro for example), Siri will initially understand you are requiring a foreign currency payment


We saw this as well, but since all our apps are for use in US only, we didn't take the time to file a Radar.

Anyone gotten SiriKit and INIntent working yet?
 
 
Q