Ad

Firebase Dynamic Links Not Listing In Console

- 1 answer

I have successfully implemented firebase dynamic link. I have created short Dynamic link also, When clicked on link it is redirected to app or playstore, but in iphone link shows error. When i checked console for created links it does not shows the link.

But when tried to create the same link in console manually it shows link already exist. Why links not listing?

My code:

Uri shortUrl;
public void buildDeepLink(@NonNull final Uri deepLink) {
    shortUrl = deepLink;
    String domain = "myapp.page.link";
    Log.d("TAG::",">"+deepLink);

    DynamicLink dynamicLink = FirebaseDynamicLinks.getInstance().createDynamicLink()
            .setLink(deepLink)
            .setDynamicLinkDomain(domain)
            // Open links with this app on Android
            .setAndroidParameters(new DynamicLink.AndroidParameters.Builder().build())
            // Open links with com.example.ios on iOS
            .setIosParameters(new DynamicLink.IosParameters.Builder("com.ios.myapp").build())
            .buildDynamicLink();

    Uri dynamicLinkUri = dynamicLink.getUri();
    Log.d("TAG::",">"+dynamicLink.getUri());

    String s = dynamicLinkUri.toString().replace("%2F","/" );
    s= s.replace("%3A",":" );
    s= s.replace("%3F","?" );
    s =s.replace("%3D","=" );
    Log.d("TAG::",">"+s);
    buildShortLink(Uri.parse(s),0);

}
public void buildShortLink(@NonNull final Uri deepLink, int minVersion) {
    shortUrl = deepLink;
    Task<ShortDynamicLink> shortLinkTask = FirebaseDynamicLinks.getInstance().createDynamicLink()
            .setLongLink(deepLink)
            .buildShortDynamicLink()
            .addOnCompleteListener(getActivity(), new OnCompleteListener<ShortDynamicLink>() {
                @Override
                public void onComplete(@NonNull Task<ShortDynamicLink> task) {
                    if (task.isSuccessful()) {
                        // Short link created
                        shortUrl = task.getResult().getShortLink();
                        Uri flowchartLink = task.getResult().getPreviewLink();
                        Log.d("TAG::",""+shortUrl+" , "+flowchartLink);
                        String s = shortUrl.toString().replace("%2F","/" );
                        s= s.replace("%3A",":" );
                        msg_body= Application.string(R.string
                                .sms_message_body)+s+Application.string(R.string.now_in)+
                                (message.replace("XXX",REF_KEY));
                        msg_body.replace("%3F","?" );
                        msg_body.replace("%3D","=" );
                        shareDeepLink(msg_body);
                    } else {
                        // Error
                        // ...
                    }
                }
            });

}
Ad

Answer

You can only view Dynamic Link stats in the "Dynamic Links" portion of the console for links that you created with the console.

For links that you create programmatically, you'll be able to see some link stats (like app_open and app_first_open) in the Analytics section of the console.

Ad
source: stackoverflow.com
Ad