Post

Replies

Boosts

Views

Activity

iOS App Clip Not Launching with Universal Link in SwiftUI
Description: I am developing an iOS App Clip using SwiftUI and am encountering an issue where the App Clip does not launch when clicking a Universal Link. Below are the key details of my setup and what I have tried: Main App Context: The main application is built with Flutter, but the App Clip is being developed natively in SwiftUI. Current Objective: I am aiming to demo the App Clip launch when a Universal Link is clicked. For now, it doesn't need to interact with the main app or process any parameters - the goal is simply to get it to launch. Development Environment: I am building the App Clip through Xcode and testing it by running the App Clip then clicking the link. Configuration: Associated domains have been added to both the App Clip target and the main "Runner" app target in Xcode, with updated provisioning profiles. The AASA file has passed validation using yURL’s Universal Links / AASA File Validator tool. AASA File Configuration: { "applinks": { "apps": [], "details": [ { "appID": "<TeamId>.<BundleId of main app>", "paths": ["/redeem"] } ] }, "appclips": { "apps": ["<TeamId>.<BundleId of app clip>"] } } Testing: Conducted on a real iOS device. Link Handling: The URL (https://vault-activation-beta.web.app/redeem) does not lead to a 404 error, and long-pressing the link in an SMS does not show any App Clip related options. Code Implementation: import SwiftUI import FirebaseCore import FirebaseAuth @main struct AppName_ClipApp: App { @UIApplicationDelegateAdaptor(AppDelegate.self) var delegate init() { FirebaseApp.configure() } var body: some Scene { WindowGroup { ContentView() .onOpenURL(perform: { url in print("Opened URL: \(url)") }) } } } class AppDelegate: NSObject, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { print("Your code here") return true } func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { if userActivity.activityType == NSUserActivityTypeBrowsingWeb, let url = userActivity.webpageURL { print("Opened URL from Universal Link: \(url)") // Handle the URL appropriately within your app } return true } } I am looking for guidance on whether there's something missing in my setup or if there are any issues with my implementation. Any suggestions or insights into why the App Clip is not launching with the Universal Link would be greatly appreciated.
1
0
769
Nov ’23