Firebase Dynamic Link doesn't work when installing app from appstore for the first time
Asked Answered
S

2

29

I'm using Firebase Dynamic Link to share my app (>=IOS 9) and invite people to events (I mean if you have the app you can join the event with the DeepLink and if you don't have it, I'll be sending you to the appstore to download the app before joining the event).

I follow the Firebase docs step:

  • I'm getting the relevant JSON at https://app_code.app.goo.gl/apple-app-site-association.
  • If my app is installed, the DeepLink is working great.
  • If my app isn't installed , the Deeplink send you to the appstore, but when opening for the first time, it doesn't work and you can't join the event.

Here is my code for getting the link on first install:

in didFinishLaunchingWithOption:

    FIROptions.default().deepLinkURLScheme =  "com.jerem.ProjectAlphaSasasa"
// "com.jerem.ProjectAlphaSasasa" is my app bundle Identifier
    FIRApp.configure()

and based on Firebase docs, on first opening, I'm using the following functions:

//MARK: First entry
//when your app is opened for the first time after installation on any version of iOS.
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool {
    print("00000000000000000")
    FIRCrashMessage("Link during first installation")
    downloadEventWithDeepLink = true
    downloadUrl = url
    return application(app, open: url, sourceApplication: nil, annotation: [:])

}

//same as previous but for older version ios 8 (not relevant)
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
    let dynamicLink = FIRDynamicLinks.dynamicLinks()?.dynamicLink(fromCustomSchemeURL: url)
    if let dynamicLink = dynamicLink {

        downloadEventWithDeepLink = true
        downloadUrl = dynamicLink.url
        return true
    }

    return false
}

In my case, downloadEventWithDeepLink is a flag (global) I check after user's login to my app (and use there the downloadUrl variable). What am I doing wrong with the setup?

Also, I don't know how to debug it. Is there a way to simulate an Appstore first install in Xcode? To find out if the previous functions (Open Url) are called?

Thanks for your help!

Steffi answered 4/1, 2017 at 19:28 Comment(5)
i have same issue did you get any solution ?Dekker
have you solve this issue?Anchoveta
@Steffi did you ever solve this?Hamilton
same here. with FirebaseDynamicLinks (~> 4.0.5) - latestStationer
same here can you solve this brooooTruman
G
2

I think to test your implementation is by deleting the app and clicking on the link, once it takes you to the App Store, you don't install the app from there and instead install from Xcode, you should receive the dynamic link call.

As a recommendation, don't worry too much about that, you should focus on testing that your dynamic link does open the app if its installed. test that it works when the app has launched and when it was closed.

If your having issues redirecting to your app, check that you have registered your bundle identifier in the url types and added your domain as applinks:your_dynamic_links_domain in the capabilities tab. If you're using a custom domain, you also have to register it into your info.plist.

I have never set the FIROptions.default().deepLinkURLScheme variable in my projects and all of them work fine

Gabrielson answered 11/1, 2020 at 17:10 Comment(3)
I wish this was right. But I have problems with Firebase dynamic link not opening from App store.Siward
what do you mean 'FROM' App Store? I have also noticed that sometimes dynamic links work only on simulator and not on real devices until you have published a simulator working version on the App StoreGabrielson
check this checklist gist.github.com/andrewrohn/774185e4e15ddcc14f0a1e3c66c943e3Gabrielson
M
0

I had the same problem with link not getting received after install. The problem was that my url scheme wasn't correctly setup.

To make it work I changed the URL types in the Info part of my target : I set the bundle ID in identifier and URL schemes field.

URL schemes setup

I also add a line in my setup code of firebase :

FIRApp.configure()
FIROptions.default().deepLinkURLScheme = "fr.machin.ES5"
Mythopoeic answered 13/4, 2017 at 9:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.