19 C
London
Saturday, September 14, 2024

iOS FireBase Dynamic Hyperlinks not engaged on first set up


I’m making an attempt to make use of Firebase Dynamic hyperlinks in an iOS App, however they don’t seem to be working accurately on first set up – I get

Deep Hyperlink doesn't comprise legitimate required params. URL params: {
  "match_message" = "No pre-install hyperlink matched for this machine.";
  "request_ip_version" = "IP_V4";
}

printed to the console.

Steps to breed:

  • Click on Dynamic Hyperlink on webpage
  • Click on “Open” on the preview web page
  • As soon as App Retailer opens, set up app from XCode
  • Click on “Paste”

If the app is already put in, I don’t get the preview web page, the hyperlink opens the app and I will learn the information from the hyperlink, so I consider my applinks and domains are all arrange accurately.

I’ve tried setting each of those to NO in data.plist

  • FirebaseDeepLinkPasteboardRetrievalEnabled
  • FirebaseAppDelegateProxyEnabled

however that does not make a distinction (besides I not get the “Paste” pop-up with PasteboardRetrieval disabled.)

I’ve tried including an appDelegate and sceneDelegate, and overriding strategies. The next will get hit on first set up:

class SceneDelegate: NSObject, UIWindowSceneDelegate {
  var window: UIWindow?
  func scene(_ scene: UIScene, willConnectTo session: UISceneSession, choices connectionOptions: UIScene.ConnectionOptions) {
      guard let _ = (scene as? UIWindowScene) else { return }
       print(connectionOptions.urlContexts.first?.url)
       print(connectionOptions.userActivities.first?.webpageURL)
       print("SceneDelegate is related!")
    }

These traces print earlier than the Deep Hyperlink doesn't comprise... message, however I get nil again for the print(connectionOptions... traces.

If paste is enabled, these traces print, then I get the paste pop up, then I get the Deep hyperlink doesn't... message.

Not one of the different “Entry level” strategies are getting hit (on first open / set up).

We use a customized area for Firebase Dynamic hyperlinks: https://l.instance.com, and these hyperlinks redirect to https://www.instance.com/?link_params_i_care_about.

Each https://l.instance.com and https://www.instance.com are added as related domains, and beneath FIRDLAddToAllowListForCustomDomainsArray

Am I lacking one thing, or have apple killed Dynamic Hyperlinks on iPhone 2 years earlier than Google kill it utterly?

UPDATE

I had misconfigured my data.plist, utilizing the string FIRDLAddToAllowListForCustomDomainsArray as a substitute of FirebaseDynamicLinksCustomDomains – that has fastened the Deep Hyperlink doesn't comprise... message.

Nonetheless, I am nonetheless not getting any of my delegate strategies being hit. Firebase is clearly studying the clipboard, and now efficiently parsing the dynamic hyperlink, however then would not seem like doing something with it.

If I put the next code in my appDelegate didFinishLaunchingWithOptions then it triggers the “Enable Paste” dialog to seem earlier, however efficiently reads the hyperlink from the clipboard, parses it and permits me to do what I would like.

if let str = UIPasteboard.basic.string {
      if let url = URL(string: str) {
        if let dynamicLink = DynamicLinks.dynamicLinks().dynamicLink(fromUniversalLink: url) {
          handleDynamicLink(dynamicLink)
        }
      }
    }

Nonetheless, this looks like a hacky workaround, and would want to mix it with an isFirstLaunchAfterInstall verify to make sure it solely ever runs as soon as.

What am I lacking, why are not one of the delegate strategies being hit?

For reference, as soon as the app is put in and a deep hyperlink adopted, the onOpenUrl completion handler (on my ContentView) will get calls. That is what the google instance exhibits to make use of for Dynamic Hyperlinks in a SwiftUI app, but it surely’s not getting referred to as after the person permits paste, and neither are any of the strategies in my app or scene delegates.

Latest news
Related news

LEAVE A REPLY

Please enter your comment!
Please enter your name here