Making onscreen content available to Siri not requesting my Transferable

Howdy,

I'm following along with this sample:

https://developer.apple.com/documentation/appintents/making-onscreen-content-available-to-siri-and-apple-intelligence

I've got everything up and building. I can confirm that the userActivity modifier is associating my App Intent via EntityIdentifier but my custom Transferable representation (text) is never being called and when Siri is doing the ChatGPT handoff, it's just offering to send a screenshot which is what it does when it has no custom representation.

What could I doing wrong? Where should I be looking?

Answered by Hunter in 818093022

A little more on this... For my document implementation, I switched from plain text to generating a PDF and using a DataTransferRepresentation instead of a ProxyRepresentation (with the string) and now it works.

No idea why the basic string didn't work but works now.

Do you get the same results with just the relevant code in a small test project? If so, please share a link to your test project. That'll help us better understand what's going on. If you're not familiar with preparing a test project, take a look at Creating a test project.

—Ed Ford,  DTS Engineer

Hi Ed,

I haven't split it out into a test project yet but that may be the next step. This is a complex app which always makes the extraction a bit more of a process.

One interesting note - I have this functionality allowing Siri to 'read' the screen in this way for two types of content. One is in the app's photo gallery which is very similar to the sample code. That one works - when it shares with ChatGPT, it correctly identifies the type as 'photo' not 'screenshot' and my Transferable implementation is called.

The second one that's not working is using the .reader.document schema, i.e. I want to share a text document with Siri but instead it only wants to share a screenshot.

Looking at the code, other than the schema type being different, the mechanics are basically the same which is where I'm confused and was curious if anyone else had done this and could be helpful.

Perhaps a sample is the next thing...

Accepted Answer

A little more on this... For my document implementation, I switched from plain text to generating a PDF and using a DataTransferRepresentation instead of a ProxyRepresentation (with the string) and now it works.

No idea why the basic string didn't work but works now.

Making onscreen content available to Siri not requesting my Transferable
 
 
Q