He configurado mi enlace dinámico como documentación, pero al hacer clic en un enlace muestra:
Deep Link does not contain valid required params. URL params: { "_cpb" = 1; "_cpt" = cpit; "_fpb" = "CJsFEPcCGgVlbi1VUw=="; "_iumchkactval" = 1; "_iumenbl" = 1; "_osl" = "https://ttnfleetsolutions.page.link/azrN2YkJQncowdQ78"; "_plt" = 3698; "_uit" = 1651; apn = "com.ttnfleetsolutions.ttnfleet.debug"; cid = 4103105643708739955; ibi = "com.ttnfleetsolutions.ttnfleetCustomer"; link = "https://www.ttnfleetsolutions.com/";}
La aplicación está abierta cuando se hace clic en el enlace dinámico, pero no llama a ninguna función y muestra un error. ¿Cómo saber si se hizo clic en el enlace o no?
mi método terminó de almorzar con opción:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool{ IQKeyboardManager.shared.enable = true FirebaseApp.configure() UIBarButtonItem.appearance().setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.clear], for: .normal) UIBarButtonItem.appearance().setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.clear], for: UIControl.State.highlighted) GMSServices.provideAPIKey(GOOGLE_API_KEY) GMSPlacesClient.provideAPIKey(GOOGLE_API_KEY) return true} y función de documentos:
@available(iOS 9.0, *) func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any]) -> Bool { return application(app, open: url, sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String, annotation: "") } func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool { if let dynamicLink = DynamicLinks.dynamicLinks().dynamicLink(fromCustomSchemeURL: url) { print("DynamicLink\(dynamicLink)") return true } return false }y
extension AppDelegate { func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool { guard userActivity.activityType == NSUserActivityTypeBrowsingWeb, let webpageURL = userActivity.webpageURL else { return false } return DynamicLinks.dynamicLinks().handleUniversalLink(webpageURL) { dynamiclink, error in guard let url = dynamiclink!.url else { return } print("url:", url) } } }Si está abriendo la aplicación utilizando la versión larga del enlace profundo, debe asegurarse de que el valor de su link esté codificado en porcentaje, de esa manera sus signos &,?,= dentro del enlace interno están codificados y procesados correctamente por firebase.