How to test firebase deferred deeplink without downloading app from playstore?

1.5k Views Asked by At

I have implemented firebase deferred deeplink and retrieving firebase deeplink data on splash screen of the app. It is working fine when app is already installed in the device. I want to test the case when link is shared and app is not installed on the device without downloading from the playstore as ply store app doesn't have receiving code. I tried mimicking the download by clicking on the link, it takes to playstore app page and then downloading it from somewhere else and opening it. But, I don't get any data in firebase PendingDynamicLinkData. And strange thing is I am not getting any callback also in getDynamicLink. But, If I click on the link and app is already installed, everything works fine.

My question is how to test the case when app is not installed on the device and then retrieving dynamic link's data.

Below is my code to retrieve data in splash screen

FirebaseDynamicLinks.getInstance().getDynamicLink(getIntent()).addOnSuccessListener(this, new OnSuccessListener<PendingDynamicLinkData>() {

            @Override
            public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) {
                Log.d("firebase deeplink", "onSuccess");
                // Get deep link from result (may be null if no link is found)
                Uri deepLink = null;
                if (pendingDynamicLinkData != null) {
                    deepLink = pendingDynamicLinkData.getLink();
                    mInterceptedData = deepLink;
                    Log.d("firebase deeplink", "onSuccess" + deepLink);
                }
            }
        }).addOnFailureListener(this, new OnFailureListener() {

            @Override
            public void onFailure(@NonNull Exception e) {
                Log.d("firebase deeplink", "getDynamicLink:onFailure" + e);
            }
        }).addOnCompleteListener(this, new OnCompleteListener<PendingDynamicLinkData>() {

            @Override
            public void onComplete(@NonNull Task<PendingDynamicLinkData> task) {
                Log.d("firebase deeplink", "getDynamicLink:onFailure" + task.getException().toString() );
            }
        });
0

There are 0 best solutions below