简体   繁体   中英

Firebase Dynamic short link facebook post from Android

I am generating a dynamic link programatically using below code :

FirebaseDynamicLinks.getInstance().createDynamicLink()
            .setLink(Uri.parse(link))
            .setDomainUriPrefix("https://example.link")
            .setAndroidParameters(
                    new DynamicLink.AndroidParameters.Builder(BuildConfig.APPLICATION_ID)
                            .setMinimumVersion(123)
                            .build())

            .setIosParameters(
                    new DynamicLink.IosParameters.Builder("com.example.ios")
                            .setAppStoreId("123456789")
                            .setMinimumVersion("1.0.1")
                            .build())

            .setSocialMetaTagParameters(
                    new DynamicLink.SocialMetaTagParameters.Builder()
                            .setTitle("Example of a Dynamic Link")
                            .setDescription("This link works whether the app is installed or not!")
                            .setImageUrl(Uri.parse("imagelink"))
                            .build())

            .buildShortDynamicLink()
            .addOnSuccessListener(shortDynamicLink -> {

               
                mInvitationUrl = shortDynamicLink.getShortLink();

            
            });

This invitation link is shared across social apps. In facebook post, it displays the link (whatever is passed in setDomainUriPrefix) below the image. Can we make it to hide this URL ?

Also, when I click on this link it directly takes to playstore even if the app is installed. But in other social apps, it opens the application if it is installed. How can I resolve this ?

This invitation link is shared across social apps. In facebook post, it displays the link (whatever is passed in setDomainUriPrefix) below the image. Can we make it to hide this URL ?

That's just have links are previewed on Facebook. You can check here https://developers.facebook.com/tools/debug/ on how your links would look like when shared on the platform.

Also, when I click on this link it directly takes to playstore even if the app is installed. But in other social apps, it opens the application if it is installed. How can I resolve this ?

This seems to need more details. Though if the Firebase Dynamic Link was opened on Facebook, there's a known issue with FDL on Facebook since the platform override how the links behave. Make sure that your app has an intent-filter for the deep link configured in the FDL and check the link received on both pendingDynamicLinkData and intent.data

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM