firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.56k stars 1.45k forks source link

Firebase Dynamic Links only working on iPhone devices #6489

Closed jtbergman closed 1 year ago

jtbergman commented 4 years ago

[REQUIRED] Step 1: Describe your environment

[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.

google-oss-bot commented 4 years ago

I found a few problems with this issue:

eldhosembabu commented 3 years ago

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?

jtbergman commented 3 years ago

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 commented 3 years ago

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!

nahashsvb commented 3 years ago

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!

eldhosembabu commented 3 years ago

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 commented 3 years ago

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

nahashsvb commented 3 years ago

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

zhahaoyu commented 3 years ago

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

RajanMaheshwari commented 3 years ago

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.

artalejo commented 3 years ago

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 ?

urthling commented 2 years ago

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

EmilKaczmarski commented 2 years ago

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

martin-desimone-mission commented 2 years ago

Facing same issue

nberthelot commented 2 years ago

Facing same issue

thruthesky commented 1 year ago

Facing the same issue

brianschardt commented 1 year ago

facing same issue

lvjsdev commented 1 year ago

facing same issue. Any updates?

ruairioliverwv commented 1 year ago

Same issue here, not just iPad but iPhone as well

fullflash commented 1 year ago

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

jmgawecki commented 1 year ago

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

davefaliskie commented 1 year ago

Also having this issue anyone find a fix?

paulb777 commented 1 year ago

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