firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

Firebase Dynamic Links only working on iPhone devices

Open jtbergman opened this issue 5 years ago • 15 comments

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 11.3.1 (also 11.7)
  • Firebase SDK version: 6.32.0
  • Firebase Component: Firebase Dynamic Links
  • Component version: 4.3.0
  • Installation method: Carthage

[REQUIRED] Step 2: Describe the problem

We have created an app to use Firebase Dynamic Links. For iPhone devices, pre-install and post-install dynamic links work without issue on all our required iOS versions (iOS 11+). However, for iPad devices only post-install dynamic links work.

All deferred dynamic links result in the following URL

<bundle-id-based-url-scheme>://google/link/?request_ip_version=IP%5FV6&match_message=No%20pre%2Dinstall%20link%20matched%20for%20this%20device%2E

Steps to reproduce:

  1. Delete app from device
  2. Click a dynamic link and receive redirect
  3. Reinstall app using Xcode / TestFlight / AppStore
  4. On all iPhones, the link will be handled in the app correctly. On all iPads, there is "no pre-install link matched"

I will try to update with a sample project.

Relevant Code:

Here is roughly what the code looks like

func application(
        _ app: UIApplication,
        open url: URL,
        options: [UIApplication.OpenURLOptionsKey : Any] = [:]
    ) -> Bool {
        print("1. \(url)")
        if let link = DynamicLinks.dynamicLinks().dynamicLink(fromCustomSchemeURL: url) {
            print("2. \(url)")
            if let url = link.url {
                // ... 
            }
            return false 
        }
        // ... 
}

Here is the output

1. <url-scheme>://google/link/?request_ip_version=IP%5FV6&match_message=No%20pre%2Dinstall%20link%20matched%20for%20this%20device%2E
2. <FIRDynamicLink: 0x283858840, url [(null)], match type: none, minimumAppVersion: N/A, match message: No pre-install link matched for this device.>

Just to re-iterate, the above only happens on iPads.

jtbergman avatar Sep 17 '20 21:09 jtbergman

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Sep 17 '20 21:09 google-oss-bot

Hi @jtbergman ,

I was not able to reproduce the issue on ipad and was able to get link matches (both strong and weak matches). Could you please try to reproduce the issue in the quick start app and let us know?

eldhosembabu avatar Sep 23 '20 18:09 eldhosembabu

Hi @eldhosembabu,

I was able to reproduce the issue with the quick start app and have more information / the cause of the issue. For our business use case, we want to skip the preview page. For links created via the console, "Skip the app preview page" is selected. Links created via the api will contain "navigationInfo":{"enableForcedRedirect":true}. This appears to be the cause of the issue.

Steps for Correct Behavior

  1. Create a link that does not have forced redirect
  2. Select the link and be redirect to the preview page
  3. On the preview page, click open to be redirected to App Store
  4. Install Quick Start Project via Xcode while in the App Store
  5. The app will correctly display the dynamic link

Reproduce the Incorrect Behavior

  1. Modify the existing link or create a new link so that forced redirect is enabled
  2. Click the click and it will redirect either to the App Store or sometimes to the embedded link (inconsistent behavior)
  3. Install Quick Start Project via Xcode while on the page that was redirected to
  4. The alert will be empty and not contain the embedded link

Note that this only affects iPads. iPhones work fine with forced redirect enabled.

If you need additional information let me know and I can provide GIFs or code.

I also realized that given the behavior this may not be an iOS issue. If so let me know where to address it.

jtbergman avatar Sep 24 '20 18:09 jtbergman

Hi @eldhosembabu,

I was wondering if there were any updates on reproducing this or if the issue may need to be raised in another repo as well?

Thanks!

jtbergman avatar Oct 08 '20 15:10 jtbergman

Could someone help to resolve this issue. We still have the same one and it is critical for us. The Dynamic links don't work on the iPads, but work on the iPhone. We will have to move to another non-free solution if the issue is not fixed soon. Something like https://branch.io. Firebase, please do something with this! I've read a lot of related closed issues, like this one: https://github.com/firebase/firebase-ios-sdk/issues/1244 And it is still observed on the latest iOS version.

NOTE: The case is related only to the checked box in the Firebase console: "Skip the app preview page (not recommended)" The steps to reproduce:

  1. Remove the app from the device if it is already installed.
  2. Open the dynamic link on iPad.
  3. Install the app from the AppStore
  4. Open the app

Thanks!

nahashsvb avatar Dec 30 '20 21:12 nahashsvb

Does that means for a Dynamic link with app preview disabled or navigationInfo":{"enableForcedRedirect":true}; the dynamic links are not retrieved in ipads but working for iphones?

I'm checking with backend teams on this and will keep you posted.

eldhosembabu avatar Jan 14 '21 00:01 eldhosembabu

Could you please confirm whether the bundle id for ipad and iphone are same?

eldhosembabu avatar Jan 14 '21 00:01 eldhosembabu

Hey @eldhosembabu! Thank you for your response!

Dynamic link with app preview disabled or navigationInfo":{"enableForcedRedirect":true};

Right, the app preview is disabled

The dynamic links are not retrieved in ipads but working for iphones?

Right

Could you please confirm whether the bundle id for ipad and iphone are same?

Confirmed, the bundle id is the same

nahashsvb avatar Jan 14 '21 12:01 nahashsvb

If I set false for enableForcedRedirect, there is no link detected on iPhone. I have ios 14.1

zhahaoyu avatar Apr 11 '21 07:04 zhahaoyu

Even in iOS 14.6 iPhone, if the preview page is not skipped, means the checkbox is unchecked for Skipping the preview page in the dashboard and the preview page comes. Still, the first app install is giving the same issue

<mybundleidscheme>://google/link/?request_ip_version=IP%5FV4&match_message=No%20pre%2Dinstall%20link%20matched%20for%20this%20device%2E

po dynamicLink.url
nil

(lldb) po dynamicLink
<FIRDynamicLink: 0x28098ca00, url [(null)], match type: none, minimumAppVersion: N/A, match message: No pre-install link matched for this device.>

Update: The above scenario works well with firebase default dynamic links i.e yourAppname.page.link

But with custom domains, it gives the above error.

RajanMaheshwari avatar Jul 10 '21 20:07 RajanMaheshwari

I am also facing the same issue when configuring a custom domain and custom deeplink. ( iOS version 14.6 as well as 14.7 )

Running the diagnosis tool DynamicLinks.performDiagnostics(completion: nil) prints that I do have the correct configuration but still when trying to get the deeplink passed on the first installation step it retrieves the following:

<FIRDynamicLink: 0x281285680, url [(null)], match type: none, minimumAppVersion: N/A, match message: No pre-install link matched for this device.> [Firebase/Analytics][I-ACS023001] Deep Link does not contain valid required params. URL params: { "match_message" = "No pre-install link matched for this device."; "request_ip_version" = "IP_V4"; }

The incorrect received deeplink in the AppDelegate is the following :

<my_custom_domain>://google/link/?request_ip_version=IP%5FV4&match_message=No%20pre%2Dinstall%20link%20matched%20for%20this%20device%2E

instead of the expected short link:

"https://<my_custom_domain>/referralCode"

If I do click on the deeplink after the app is installed it all works as expected, but not when being redirected to the Apple Store and installing the app.

Could somebody please help out and solve this issue ?

artalejo avatar Aug 17 '21 16:08 artalejo

This has now been an issue for months -- is there any planned fix for this?

urthling avatar Dec 07 '21 00:12 urthling

I there any update? I'm facing the same issue

EmilKaczmarski avatar Jan 27 '22 16:01 EmilKaczmarski

Facing same issue

martin-desimone-mission avatar Mar 02 '22 00:03 martin-desimone-mission

Facing same issue

nberthelot avatar Aug 17 '22 13:08 nberthelot

Facing the same issue

thruthesky avatar Feb 02 '23 03:02 thruthesky

facing same issue

brianschardt avatar Feb 09 '23 20:02 brianschardt

facing same issue. Any updates?

lvjsdev avatar Mar 02 '23 19:03 lvjsdev

Same issue here, not just iPad but iPhone as well

ruairioliverwv avatar Mar 07 '23 11:03 ruairioliverwv

same issue "google/link/?request_ip_version=IP_V4&match_message=No%20pre-install%20link%20matched%20for%20this%20device."

fullflash avatar Apr 24 '23 01:04 fullflash

Hi there, has anyone found the solution here? I am facing the same issue :(

jmgawecki avatar May 04 '23 09:05 jmgawecki

Also having this issue anyone find a fix?

davefaliskie avatar Jul 09 '23 04:07 davefaliskie

The Firebase Dynamic Links service will be shutdown on August 25, 2025. In the meantime, only critical or security issues will be fixed in the SDK.

More at https://firebase.google.com/support/dynamic-links-faq

paulb777 avatar Aug 22 '23 16:08 paulb777