Integrate your custom collaboration app with Messages

RSS for tag

Discuss the WWDC22 Session Integrate your custom collaboration app with Messages

Posts under wwdc2022-10093 tag

4 Posts

Post

Replies

Boosts

Views

Activity

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... Added the Shared with You entitlement When preparing to share, generate a SWCollaborationMetadata, and pass it to the share picker Added the SWCollaborationCoordinator and functions to handle the callback from messages when the user has gone to send the invitation 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.)
4
0
1.7k
Aug ’22
Crashes when trying to register SWCollaborationMetadata in NSItemProvider
We're doing a custom collaboration and trying to follow the example code in the presentation "Integrate your custom collaboration app with Messages". This issue is happening on iOS 16 beta 4. After creating and setting up a SWCollaborationMetadata object, we're creating an NSItemProvider and registering the metadata object. The call to registerObject() is crashing with the exception: +[_SWCollaborationMetadata writableTypeIdentifiersForItemProvider]: unrecognized selector sent to class 0x1ea29aed0 It seems like the SWCollaborationMetadata is maybe not actually compliant to the NSItemProviderWriting protocol, despite the fact that it is documented to be so. In fact, looking at the header `SWCollaborationMetadata.h, it looks like it does not comply with NSItemProviderWriting after all: @interface SWCollaborationMetadata : NSObject <NSSecureCoding, NSCopying, NSMutableCopying> ...which of course would explain the crash. I've set up a sample project which contains basically identical code to what is shown in the WWDC session, and still getting this issue. I have added the SharedWithYou entitlement. Is this a known issue in the current betas, or is there some updated sample code somewhere. Here's the function I'm testing it with: func share() {      let localIdentifier = SWLocalCollaborationIdentifier(rawValue: "identifier")      let metadata = SWCollaborationMetadata(localIdentifier: localIdentifier)      metadata.title = "Content Title"      metadata.initiatorHandle = "user@example.com"      let formatter = PersonNameComponentsFormatter()      if let components = formatter.personNameComponents(from: "Devin") {          metadata.initiatorNameComponents = components      }     let itemProvider = NSItemProvider()      itemProvider.registerObject(metadata, visibility: .all)      let activityConfig = UIActivityItemsConfiguration(itemProviders: [itemProvider])      let shareSheet = UIActivityViewController(activityItemsConfiguration: activityConfig)   self.present(shareSheet, animated: true) } The crash happens at the call to itemProvider.registerObject(metadata, visibility: .all) Thanks, Adam
1
0
1.4k
Aug ’22
Cannot get correct height for wrapped SWAttributionView
I am attempting to utilize the new SWAttributionView in SwiftUI since I am adding SharedWithYou support to one of my apps. Below is the UIViewRepresentable I created to wrap the UIKit component. I have tried many combinations of view modifiers, but have not figured out how to get the height to be just what's needed. My goal is to pin the view near the bottom trailing edge of the view containing it. If I do the same UIViewRepresentable wrapping a UILabel, for testing purposes, I can simple use .fixedSize on it and a Spacer() to get the vertical effect I am looking for. struct AttributionView: UIViewRepresentable {     var highlight: SWHighlight     func makeUIView(context: Context) -> SWAttributionView {         SWAttributionView()     }     func updateUIView(_ uiView: SWAttributionView, context: Context) {         uiView.highlight = highlight         uiView.backgroundStyle = .material       uiView.horizontalAlignment = .trailing         uiView.displayContext = .summary     } }
0
0
1.2k
Jul ’22
Demo App Needed
Thanks for the session. I hope I am not the only one that finds cryptography confusing or hard. It would be great if there was an example app or source code, so that we can check it out and understand the steps to integrate it with the apps. Any plans for this?
0
1
1.1k
Jun ’22
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... Added the Shared with You entitlement When preparing to share, generate a SWCollaborationMetadata, and pass it to the share picker Added the SWCollaborationCoordinator and functions to handle the callback from messages when the user has gone to send the invitation 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.)
Replies
4
Boosts
0
Views
1.7k
Activity
Aug ’22
Crashes when trying to register SWCollaborationMetadata in NSItemProvider
We're doing a custom collaboration and trying to follow the example code in the presentation "Integrate your custom collaboration app with Messages". This issue is happening on iOS 16 beta 4. After creating and setting up a SWCollaborationMetadata object, we're creating an NSItemProvider and registering the metadata object. The call to registerObject() is crashing with the exception: +[_SWCollaborationMetadata writableTypeIdentifiersForItemProvider]: unrecognized selector sent to class 0x1ea29aed0 It seems like the SWCollaborationMetadata is maybe not actually compliant to the NSItemProviderWriting protocol, despite the fact that it is documented to be so. In fact, looking at the header `SWCollaborationMetadata.h, it looks like it does not comply with NSItemProviderWriting after all: @interface SWCollaborationMetadata : NSObject <NSSecureCoding, NSCopying, NSMutableCopying> ...which of course would explain the crash. I've set up a sample project which contains basically identical code to what is shown in the WWDC session, and still getting this issue. I have added the SharedWithYou entitlement. Is this a known issue in the current betas, or is there some updated sample code somewhere. Here's the function I'm testing it with: func share() {      let localIdentifier = SWLocalCollaborationIdentifier(rawValue: "identifier")      let metadata = SWCollaborationMetadata(localIdentifier: localIdentifier)      metadata.title = "Content Title"      metadata.initiatorHandle = "user@example.com"      let formatter = PersonNameComponentsFormatter()      if let components = formatter.personNameComponents(from: "Devin") {          metadata.initiatorNameComponents = components      }     let itemProvider = NSItemProvider()      itemProvider.registerObject(metadata, visibility: .all)      let activityConfig = UIActivityItemsConfiguration(itemProviders: [itemProvider])      let shareSheet = UIActivityViewController(activityItemsConfiguration: activityConfig)   self.present(shareSheet, animated: true) } The crash happens at the call to itemProvider.registerObject(metadata, visibility: .all) Thanks, Adam
Replies
1
Boosts
0
Views
1.4k
Activity
Aug ’22
Cannot get correct height for wrapped SWAttributionView
I am attempting to utilize the new SWAttributionView in SwiftUI since I am adding SharedWithYou support to one of my apps. Below is the UIViewRepresentable I created to wrap the UIKit component. I have tried many combinations of view modifiers, but have not figured out how to get the height to be just what's needed. My goal is to pin the view near the bottom trailing edge of the view containing it. If I do the same UIViewRepresentable wrapping a UILabel, for testing purposes, I can simple use .fixedSize on it and a Spacer() to get the vertical effect I am looking for. struct AttributionView: UIViewRepresentable {     var highlight: SWHighlight     func makeUIView(context: Context) -> SWAttributionView {         SWAttributionView()     }     func updateUIView(_ uiView: SWAttributionView, context: Context) {         uiView.highlight = highlight         uiView.backgroundStyle = .material       uiView.horizontalAlignment = .trailing         uiView.displayContext = .summary     } }
Replies
0
Boosts
0
Views
1.2k
Activity
Jul ’22
Demo App Needed
Thanks for the session. I hope I am not the only one that finds cryptography confusing or hard. It would be great if there was an example app or source code, so that we can check it out and understand the steps to integrate it with the apps. Any plans for this?
Replies
0
Boosts
1
Views
1.1k
Activity
Jun ’22