SWCollaborationMetadata does not appear in Messages

Our app has a custom collaboration setup, but we would like to support Shared with You. We have setup the app following the sessions. To summarize...

  1. Added the Shared with You entitlement
  2. When preparing to share, generate a SWCollaborationMetadata, and pass it to the share picker
  3. Added the SWCollaborationCoordinator and functions to handle the callback from messages when the user has gone to send the invitation
  4. Setup Associated Domains and universal links. These seem to work. Pasting a universal link in messages directly does present nice UI.

So far so good. The picker appears, and we can click on Messages in the popover, and Messages opens. But it is completely empty. It does show the person we clicked (if it was an individual), but there is no message preparation UI or anything for the user to do. It is just an empty text field the user can type a message in. Nothing about setting up our collaboration.

We do get a small amount of information in the console:

2022-07-09 09:46:08.756155+0200 Agenda[48995:965560] [Framework] No filtered items to share

2022-07-09 09:46:11.294593+0200 Agenda[48995:965560] [NSExtension] Extension request contains input items but the extension point does not specify a set of allowed payload classes. The extension point's NSExtensionContext subclass must implement `+_allowedItemPayloadClasses`. This must return the set of allowed NSExtensionItem payload classes. In future, this request will fail with an error.

2022-07-09 09:46:11.346694+0200 Agenda[48995:984764] [ShareSheet] Connection invalidated

Should this already be working in Beta 3?

If so, what are we missing? Is it necessary to setup a GroupActivity or something like that? There was no mention of anything like that in the WWDC videos, but maybe it is supposed to be obvious. (Sample code would be a huge help with something like this.)

Hi,

If you have the entitlement and the SWCollaborationMetadata, Messages should show the right thing, so there must be something going wrong elsewhere. Could I ask you to file a report on Feedback Assistant (https://feedbackassistant.apple.com) with a sysdiagnose attached, and then provide the ID number here? You may also want to install a Logging Profile first to make your sysdiagnose more actionable (https://developer.apple.com/bug-reporting/profiles-and-logs/) - the Messages profile will likely be useful here.

Thanks for the response.

I have done as suggested, and the Feedback ID is FB10681825

Hi! It looks like you are hitting a bug in the flow which will need to be fixed on the Messages side. The fix will come out in a future update. Sorry about that! On the bright side, at least you are implementing it correctly.

Thank you for filing feedback!

I was able to get this working, though not optimally. It seems that the SWCollaborationMetadata does not like having the default options be nil. In that case, it simply does not appear in messages.

The solution for me was to provide SWCollaborationShareOptions(optionsGroups: []). The downside is that the "options" label still appears, but shows a completely empty popover for the options :( At least it does now appear in messages, and does work when posted to others.

If you are having trouble getting the invitation to appear in Messages, it is also worth checking the Settings/System Preferences, and in the Messages Preferences. There are various restrictions there on Shared with You, and if your app isn't allowed, they won't show up.

SWCollaborationMetadata does not appear in Messages
 
 
Q