Juanje
Juanje

Reputation: 1315

Firebase DynamicLinks failed on version 16.1.1

I have Firebase Dynamic Links on my app and works fine. The problem comes when I update the lib to version 16.1.1 when all links crash when I try to get the sort link. Does anyone know what is happening in this update?

The code for the links is the following:

    FirebaseDynamicLinks.getInstance().createDynamicLink()
            .setLink(linkUri)
            .setDynamicLinkDomain(context.getString(R.string.firebase_link_domain))
            .setAndroidParameters(new DynamicLink.AndroidParameters.Builder().build())
            .setSocialMetaTagParameters(
                    new DynamicLink.SocialMetaTagParameters.Builder()
                            .setTitle(item.getTitle())
                            .setImageUrl(Uri.parse(url))
                            .setDescription(context.getString(R.string.app_name_long))
                            .build())
            .buildShortDynamicLink()
            .addOnCompleteListener(new OnCompleteListener<ShortDynamicLink>() {
                @Override
                public void onComplete(@NonNull Task<ShortDynamicLink> task) {
                    if (task.isSuccessful()) {
                        Uri shortLink = task.getResult().getShortLink();
                        view.showSharing(shortLink);
                        view.setProgressBar(false);

                    } else {
                        Toast.makeText(context, R.string.share_error, Toast.LENGTH_LONG).show();
                        Log.e("FIREBASE_SHORT_LINK", task.getException().getLocalizedMessage());
                    }
                }
            });

Upvotes: 1

Views: 84

Answers (1)

dev.for.fun
dev.for.fun

Reputation: 1240

This has been a known issue that's been asked from the support. According to them, there are currently two workarounds for this issue:

  • Use the Dynamic Link version 16.0.1 to be able to generate a short Dynamic Link
  • Stick in using version 16.1.1, create a long link first then try to shorten the long Dynamic Link using this guide

Upvotes: 1

Related Questions