Cannot Accept CloudKit Share After First App Install

I have an iOS app (1Address) which allows users to share their address with family and friends using CloudKit Sharing.

Users share their address record (CKRecord) via a share link/url which when tapped allows the receiving user to accept the share and have a persistent view into the sharing user's address record (CKShare).

However, most users when they recieve a sharing link do not have the app installed yet, and so when a new receiving user taps the share link, it prompts them to download the app from the app store.

After the new user downloads the app from the app store and opens the app, my understanding is that the system (iOS) will/should then vend to my app the previously tapped cloudKitShareMetadata (or share url), however, this metadata is not being vended by the system. This forces the user to re-tap the share link and leads to some users thinking the app doesn't work or not completing the sharing / onboarding flow.

Is there a workaround or solve for this that doesn't require the user to tap the share link a second time?

In my scene delegate I am implementing:

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {...}

And also

func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {...}

And also:

func windowScene(_ windowScene: UIWindowScene, userDidAcceptCloudKitShareWith cloudKitShareMetadata: CKShare.Metadata) {...}

And:

func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {...}

Unfortunately, none of these are called or passed metadata on the initial app run after install. Only after the user goes back and taps a link again can they accept the share.

This documentation: https://developer.apple.com/documentation/cloudkit/ckshare says that adding the CKSharingSupported key to your app's Info.plist file allows the system to launch your app when a user taps or clicks a share URL, but it does not clarify what should happen if your app is being installed for the first time.

This seems to imply that the system is holding onto the share metadata and/or url, but for some reason it is not being vended to the app on first run.

Open to any ideas here for how to fix and I also filed feedback: FB20934189.

the system (iOS) will/should then vend to my app the previously tapped cloudKitShareMetadata (or share url)

The verb 'to vend' means to sell (something). So what do you mean by that?

Isn't it just the matter of having the app access the CloudKit record type and then create a new record when it starts up for the first time?

I would stay away from it, but if use of the CKShare object works, that's good for you. I was forced to change my plans twice after I didn't get the result I wanted with it in December.

Cannot Accept CloudKit Share After First App Install
 
 
Q