firebase-android-sdk
firebase-android-sdk copied to clipboard
DynamicLink consider only default FirebaseApp
Describe your environment
- Android Studio version: Android Studio 4.2 Canary 16 Build #AI-202.7660.26.42.6939830, built on October 29, 2020
- Firebase Component: Dynamic links
- Component version: 19.1.1
Describe the problem
DynamicLink consider only the default firebase application, and it's not possible to use another instance of FirebaseApp
Steps to reproduce:
- Init 2 FirebaseApp (for example "default" through config file google-services.json, and "secondary" through options)
- Setup "secondary" firebase project with Dynamic links required settings (domain: ....page.link)
- Try to create a short dynamic link with a "second" instance (code below)
=> Error:
400: Your project (<"default" firebase project id>) has not configured Dynamic Links.
Relevant Code:
FirebaseDynamicLinks.getInstance(FirebaseApp.getInstance("secondary"))
.createDynamicLink()
.setDomainUriPrefix(<domain from "secondary" firebase project>)
.setLink("https://example.com")
.buildShortDynamicLink()
.addOnSuccessListener {
//
].addOnFailureListener {
//
}
Link to related code https://github.com/firebase/firebase-android-sdk/blob/master/firebase-dynamic-links/src/main/java/com/google/firebase/dynamiclinks/DynamicLink.java#L99
if (FirebaseApp.getInstance() != null) {
builderParameters.putString(
KEY_API_KEY, FirebaseApp.getInstance().getOptions().getApiKey());
}
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.
Internal bug number 174064658.
Same issue.
- Should I have to enable the default firebase project for dynamic link ? Or Can just enable the second project for firebase dynamic link?
- Can I use the url prefix created in second project for native short link API? I had received this
error=400: Your project does not own Dynamic Links domain
Any updates for this bug? Thanks.
Hi folks, we'd like to inform you that 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