Yea the App Clip videos and docs should emphasize on this. My App Clip's deep link worked after using scene(_willConnectTo:options:) in the scene delegate of the app clip:
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
}
// Check for specific URL components that you need.
guard let path = components.path else {
return
}
if let vc = window?.rootViewController as? AppClipVC {
if path.lowercased().contains("map") {
vc.clipType = "map"
}
if path.lowercased().contains("card") {
vc.clipType = "card"
}
}
}
Post
Replies
Boosts
Views
Activity
I solved it with the magic of starting fresh hehe. I was using the Swift Package with an App Clip. All I did was deleting the App Clip and creating it again. I linked the Swift Package to it, and bam it's working in .ipa exported file and the App Store didn't complain.