I am using the below code
FirebaseDynamicLinks.getInstance()
.getDynamicLink(getIntent())
.addOnSuccessListener(this, new OnSuccessListener<PendingDynamicLinkData>() {
@Override
public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) {
...
}
})
.addOnFailureListener(this, new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
}
});
I some devices, when I dont launch threw a deeplink, onSuccess is called with pendingDynamicLinkData == null, which is fine but on some devices, both onSuccess and onFailure not getting called at all. How to fix this?
If I'm getting you right you mean to say there are two cases happening inside your code with your firebase dynamic links:-
Case 1 -> On some devices the onSuccess(PendingDynamicLinkData pendingDynamicLinkData) method is being called. ( which is the expected behaviour)
Case 2 -> On some devices Neither the onSuccess(PendingDynamicLinkData pendingDynamicLinkData) callback is being called nor onFailure(Exception e).
I think this can if you are not executing your "Firebase.getInstance()..." part of the code in the activity which is currently in front of the user, or if the activity where you wrote this code is now in the background.
For Ex: If you execute this code( your Firebase.getInstance()... part of code) in your SplashActivity, which disappears usually after few seconds and your MainActivity is now present in front of the user, then in some devices Neither your OnSuccess(PendingDynamicLinkData pendingDynamicLinkData) nor your onFailure(Exception e) callback will be called.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With