apple/sample-cloudkit-sharing

Migration to SwiftUI App Lifecycle still not possible under iOS 16

Opened this issue · 1 comments

Unfortunately the app (an all apps using CloudKit Share) still requires UIKit Lifecycle (AppDelegate and SceneDelegate) and currently cannot be migrated to SwiftUI Lifecycle because there is no implementation for
func windowScene(_ windowScene: UIWindowScene, userDidAcceptCloudKitShareWith cloudKitShareMetadata: CKShare.Metadata)
available for a SwiftUI Lifecycle app.
This means that basic SwiftUI features like SceneStorage are still not available for apps using CloudKit Share.

I have found that the func windowScene is called when the share link is executed, but only if the app is opened first. Otherwise a sharelink will only launch the app, but not save the shared data in the link. Is there any way to get the function to be observed when the sharelink launches the app? or is this part of the missing functionality?