7

i have setup my dynamic link as a documentation but while clicking a link it shows :

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/";

}

App is open when dynamiclink clicked but it dose not call any function and show error how to get know link clicked or not?

my didfinishlunchingwithoption methode:

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

} and function from docs:

@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
}

and

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)
    }
    }
 }
amir thapa
  • 103
  • 1
  • 1
  • 10

1 Answers1

2

If you are opening the app using the long version of the deep link you should make sure your link value is percent encoded, that way your &,?,= signs inside the inner link are encoded and properly processed by firebase.

Mark Kazakov
  • 946
  • 12
  • 17
  • 1
    This point solved my issue and confuse. https://stackoverflow.com/questions/61592344/ios-firebase-dynamic-link-with-weird-long-dynamic-link-url-format-issue – Joshpy May 05 '20 at 06:25
  • Could you tell how to make sure the link is percent encoded? I am using Flutter dynamic links and keep having the same issue. In my long version of the deeplink is also a '&' character. – SilkeNL Apr 04 '23 at 08:26
  • @SilkeNL from what I found in this page https://stackoverflow.com/questions/59639726/how-to-encode-urls-in-dart you can use uri = 'http://example.com/path/to/page?name=ferret john'; var encoded = Uri.encodeFull(uri); – Mark Kazakov Apr 04 '23 at 15:13