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

0

7

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() );
            }
        });
Chenopod answered 25/5, 2018 at 9:9 Comment(4)
Have you tried installing app on device right after clicking the link? As far as i know you don't need to click install on google play or download the new version from somewhere else.Crimmer
Hi. I tried that but this is not working.Chenopod
@MonikaSaini Hi, did you find a solution for this question?Wildwood
As @mertnyuksel said, you should be able to test this by clicking on the dynamic link and then installing the APK. Just make sure that your package id and the signing key's SHA match the configuration on Firebase. If you're using a debug signing key make sure you have it's SHA setup in Firebase.Interlude

© 2022 - 2024 — McMap. All rights reserved.