Firebase动态链接在我从whatsapp手机发送时不显示图像,但是在我从同一链接上的whatsapp桌面发送时显示。
我从firebase consol构建了两个链接,另一个从代码构建了链接,当我通过电话发送时,它们均未显示在whatsapp上的图像,而是在我从whatsapp桌面发送时显示的。
我尝试了所有手机,但都没有显示图片。
我的图像尺寸: 290,036字节, 315,196字节
DynamicLink dynamicLink = FirebaseDynamicLinks.getInstance().createDynamicLink()
.setLink(Uri.parse("https://****.web.app/")) // https://www.example.com/
.setDomainUriPrefix(your_subdomain)
.setAndroidParameters( new DynamicLink.AndroidParameters.Builder(package_name)
.setMinimumVersion(0)
.build())
/*.setIosParameters( new DynamicLink.IosParameters.Builder("com.example.ios")
.setAppStoreId("123456789")
.setMinimumVersion("1.0.1")
.build())*/
/*.setGoogleAnalyticsParameters(new DynamicLink.GoogleAnalyticsParameters.Builder()
.setSource("orkut")
.setMedium("social")
.setCampaign("example-promo")
.build())*/
/*.setItunesConnectAnalyticsParameters( new DynamicLink.ItunesConnectAnalyticsParameters.Builder()
.setProviderToken("123456")
.setCampaignToken("example-promo")
.build())*/
.setSocialMetaTagParameters(new DynamicLink.SocialMetaTagParameters.Builder()
.setTitle(titleSocial)
.setDescription(description)
.setImageUrl(Uri.parse(imageUrl))
.build())
.buildDynamicLink();
Task<ShortDynamicLink> shortDynamicLinkTask = FirebaseDynamicLinks .getInstance().createDynamicLink()
.setLongLink(buildDynamicLink())
.buildShortDynamicLink()
.addOnCompleteListener(new OnCompleteListener<ShortDynamicLink>() {
@Override
public void onComplete(@NonNull Task<ShortDynamicLink> task) {
if(task.isSuccessful()){
Uri shortLink = task.getResult().getShortLink();
//Uri flowchartLink = task.getResult().getPreviewLink();
Log.d(TAG, "shortLink: " + shortLink);
link = shortLink.toString();
saveShareLink();
sendingShareLink();
}else {
Log.d(TAG, "shortLink: fail" + task.getException().getMessage());
}
}
});