DynamicLinks getDynamicLink sometimes not resolving long links correctly
See original GitHub issue[READ] Step 1: Are you in the right place?
Issues filed here should be about bugs in the code in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:
- For general technical questions, post a question on StackOverflow with the firebase tag.
- For general Firebase discussion, use the firebase-talk google group.
- For help troubleshooting your application that does not fall under one of the above categories, reach out to the personalized Firebase support channel.
[REQUIRED] Step 2: Describe your environment
- Android Studio version: 7.0.0
- Firebase Component: dynamic-links (Database, Firestore, Storage, Functions, etc)
- Component version: BoM 28.3.1 (most current stable as of this typing)
[REQUIRED] Step 3: Describe the problem
👋 Hi there, I help maintain https://github.com/invertase/react-native-firebase/ and I’m seeing flaky behavior on this API call, I was hoping you could help me out.
The specific test case is here:
Which exercises this chunk of Java, with a long link:
Steps to reproduce:
Feed a long link into the getDynamicLink
method, and sometimes you get the target URI back as a return value, sometimes you get the long link back unchanged
Relevant Code:
// feed it this
private String TEST_LINK2 = `https://reactnativefirebase.page.link/?link=https://invertase.io/hire-us&apn=com.invertase.testingutm_source=github`;
// expect this
private String TEST_LINK2_TARGET = 'https://invertase.io/hire-us';
public void resolveLink(String link) {
try {
FirebaseDynamicLinks.getInstance()
.getDynamicLink(Uri.parse(link))
.addOnCompleteListener(
task -> {
if (task.isSuccessful()) {
PendingDynamicLinkData linkData = task.getResult();
// Note: link == null if link invalid, isSuccessful is only false on processing
// error
if (linkData != null
&& linkData.getLink() != null
&& linkData.getLink().toString() != null) {
String linkUrl = linkData.getLink().toString();
int linkMinimumVersion = linkData.getMinimumAppVersion();
Bundle linkUtmParameters = linkData.getUtmParameters();
System.out.println("resolved to: " + linkUrl);
} else {
System.err.println("Dynamic link not found");
}
} else {
System.err.println("resolve-link-error");
}
});
} catch (Exception e) {
// This would be very unexpected, but crashing is even less expected
System.err.println("Unknown resolve failure");
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Dynamic Links - Can't get Url in android after install app from ...
When I use the long instead of short links, everything works perfectly fine. It's really just the short link, that is not working....
Read more >Firebase Dynamic Link is not caught by getInitialLink if app is ...
1) The link properly opens the app if the app is not running but the getInitialLink does not get it. 2) If the...
Read more >Working with Firebase Dynamic links | by Jyoti Dubey - Medium
A Dynamic Link is a deep link into your app that works whether or not your app is installed. It carries the following...
Read more >Getting started with Dynamic Links on Android (Part 2 )
On today's episode of Firecasts, our host Sumit Chandel will show us how to receive and interpret the link in code for our...
Read more >Debugging Dynamic Links - Firebase
Generate the flowchart by adding the d=1 parameter to any short or long Dynamic Link. For example, example.page.link/suffix?d=1 for a short ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @mikehardy We are looking into this issue. We have not been able to reproduce yet. We’ll likely need a repro or more specific details about a Firebase issue to help more. Moreover, try reproducing with our quickstart. This will help us isolate the issue and discard conflicts with other third party libraries being used. Please let me know if you have questions about this.
That’s fair - I haven’t been able to come up with a reliable reproduction. This may only happen in far-fetched testing scenarios 🤷