This is a limitation in App Clip apple for some reason didn't describe or emphasize in their docs.
Let's consider this scenario:
- User scans QR code and install and runs App Clip.
- User decides to install the full app based on the App Clip Card reference or the App Clip reference.
- Full app opens
We would expect the invocation URL will be passed into the full app, BUT IT DOES NOT HAPPEN. The poor user is forced to scan the QR code, and then the full app is opened using a Universal Link flow.
The App Clip is opened using in both cases
- When the App Clip is not already installed on the device, using:
func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
// Get URL components from the incoming user activity
guard userActivity.activityType == NSUserActivityTypeBrowsingWeb,
let incomingURL = userActivity.webpageURL,
let components = NSURLComponents(url: incomingURL,
resolvingAgainstBaseURL: true)
else {
return
}
// log url
print("AppClip invocation url is : \(incomingURL)")
}
- App Clip already installed on the device. The user won't see a difference, but there is a difference in the scene life-cycle:
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let _ = (scene as? UIWindowScene) else { return }
// Get URL components from the incoming user activity.
guard let userActivity = connectionOptions.userActivities.first,
userActivity.activityType == NSUserActivityTypeBrowsingWeb,
let incomingURL = userActivity.webpageURL,
let components = NSURLComponents(url: incomingURL, resolvingAgainstBaseURL: true)
else {
return
}
// log url
print("AppClip invocation url is : \(incomingURL)")
}
We solved the issue for AppsFlyer users by allowing them to use our OneLink flow for deferred deep linking