我试图分享Firebase动态链接
final Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
final String link = "https://play.google.com/store/apps/details?id=com.vizumlab.vizuminfo";
FirebaseDynamicLinks.getInstance().createDynamicLink()
.setLink(Uri.parse(String.format("https://vizum.page.link/?link=%s&msgid=%s", link, id)))
.setAndroidParameters(new DynamicLink.AndroidParameters.Builder("com.vizumlab.vizuminfo").setFallbackUrl(Uri.parse(link)).build())
.setDynamicLinkDomain("vizum.page.link")
.buildShortDynamicLink()
.addOnSuccessListener(l -> {
shareIntent.putExtra(Intent.EXTRA_TEXT, activity.getString(R.string.message_share_format_text, name,
"https://vizum.page.link?link=" + link + "&apn=com.vizumlab.vizuminfo&ofl=https://vizuminfo.com"));
activity.startActivity(Intent.createChooser(shareIntent, activity.getString(R.string.message_share)));
ReceiverBus.INSTANCE.notify(R.id.code_show_loader, false);
}
)
有人知道如何解决这个问题吗?
UPD:
此用于动态链接创建的代码也不适合FB
shareIntent.putExtra(Intent.EXTRA_TEXT, activity.getString(R.string.message_share_format_text, name, l.getShortLink().toString()));