Bug 44804 - Intents Extension projects trigger "Error with extension request Error Domain=NSCocoaErrorDomain Code=4097"
Summary: Intents Extension projects trigger "Error with extension request Error Domain...
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 10.0 (iOS10)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-09-27 23:57 UTC by Larry O'Brien
Modified: 2016-09-30 10:51 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Sample solution demonstrating project (needs SiriKit prov pro) (20.52 KB, application/zip)
2016-09-27 23:57 UTC, Larry O'Brien
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description Larry O'Brien 2016-09-27 23:57:25 UTC
Created attachment 17772 [details]
Sample solution demonstrating project (needs SiriKit prov pro)

I have been unable to run an Extension Project successfully, I always get "Sorry, you'll need to continue in the app" and I see the following messages in the Console:

    Hub connection error Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.xamarin.intents3.intents3extension" UserInfo={NSDebugDescription=connection to service named com.xamarin.intents3.intents3extension}
    __52-[ADExtensionService handleCommand:forDomain:reply:]_block_invoke_2.142 Error with extension request Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.xamarin.intents3.intents3extension" UserInfo={NSDebugDescription=connection to service named com.xamarin.intents3.intents3extension}
    -[ADCommandCenter _handleServiceReply:error:forCommand:] Handling service error Error Domain=kAFAssistantErrorDomain Code=1301 "(null)" UserInfo={NSUnderlyingError=0x10062a680 {Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.xamarin.intents3.intents3extension" UserInfo={NSDebugDescription=connection to service named com.xamarin.intents3.intents3extension}}} for command <private>

Steps to reproduce:

Create a single-view app. 
Add com.apple.developer.siri entitlement
Add NSSiriUsageDescription to info.plist
Use a provisioning profile configured for SiriKit 
In the app, call `INPreferences.RequestSiriAuthorization( (status) => {} );`  
...
Right-click on the app and choose "Add / Add new project... / Intents Extension"

Add `[Export("handleSendMessage:completion:")]` to IntentHandler.HandleSendMessage (Note: I believe this should be part of the template)

Note that HandleSendMessage passes to the `completion` handler INSendMessageIntentResponseCode.Success 

Deploy to phone.
Run the app once manually to authorize Siri access
Use Siri to "Send a message using Intents3" (or whatever your app is called)
Siri will respond with "Sorry, you'll need to continue in the app" 

Open the phone Console log and you will see the above-referenced errors. 

These errors also occur if you replace the Intents with another domain, e.g., workouts instead of messages.
Comment 1 Larry O'Brien 2016-09-28 21:14:27 UTC
I should clarify that this applies only to Intents Extensions aka SiriKit.
Comment 2 Vincent Dondain [MSFT] 2016-09-30 10:51:42 UTC
Hey, so the Intents extension totally works for me, I've tried it before (when creating the template) and again with your sample.

The only thing I did with your sample was to use the right signing identity and provisioning profile (with Siri capability) manually on all 3 projects and update the bundle ids to match my AppID.

Then by talking to Siri on the phone I got:
https://www.dropbox.com/s/pkpxyutj6gr3qba/stale_thumb_60b.jpg?dl=0

Versions information:
https://gist.github.com/VincentDondain/f8633d81cc033534788d9a503d6fb23f\

Also to answer your comment: no `[Export("handleSendMessage:completion:")]` shouldn't be part of the template because explicit export are not necessary with required protocol members (only with the optional ones).

You must have some local issues but it's for sure not the sample nor the bindings.

Make sure the right provisioning profile is selected and that your AppID's bundle id is `com.xamarin.intents3` in this case.

I'm gonna close this bug but feel free to reopen it if you still can't get it to work but in any case I'll need more info to reproduce it.