Hey,
I'm trying to add an App Clip on my application! I use
in order to detect the link. However, this doesn't seem to get called the first time the App Clip is opened. The second time I launch it, it does get called and I'm able to display the appropriate information. I can verify this both by running the app through Xcode with the URL in the App Clip Scheme and also through TestFlgiht.
Moreover, I added
this to my website but the banner with App Clip doesn't show up on an iOS 14 device that doesn't have the app.
I'm trying to add an App Clip on my application! I use
Code Block func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
in order to detect the link. However, this doesn't seem to get called the first time the App Clip is opened. The second time I launch it, it does get called and I'm able to display the appropriate information. I can verify this both by running the app through Xcode with the URL in the App Clip Scheme and also through TestFlgiht.
Moreover, I added
Code Block <meta name="apple-itunes-app" content="app-id=1479244278, app-clip-bundle-id=com.Swipe4Fave.fave.Clip">
this to my website but the banner with App Clip doesn't show up on an iOS 14 device that doesn't have the app.
On first launch, activities are delivered via scene(_:willConnectTo:options:) as part of the connectionOptions. The individual callbacks are only invoked if a new user activity comes in, after the clip has been launched. This is part of UIKit, and the behavior is the same for apps or app clips. You can simplify your own code by forwarding any user activities.
Code Block swift class MySceneDelegate : NSObject, UISceneDelegate { func scene( _ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions ) { // Do scene connection setup. // Then forward any activities. for activity in connectionOptions.userActivities { scene(scene, continue: activity) } } func scene(_ scene: UIScene, continue userActivity: NSUserActivity) { // Perform actions with the activity. } }