Facebook Messenger Android SDK 分享 setExternalUri

Facebook Messenger Android Sdk Share setExternalUri

我有两个类似的 URI。

Uri uri = Uri.parse("android.resource://"+activity.getPackageName() +"/"+ R.drawable.tree);
Uri exuri = Uri.parse("https://cdn.xxx.com/slider/xxx.png");

我用 Facebook SDK 设置它们;

ShareToMessengerParams shareToMessengerParams =
ShareToMessengerParams.newBuilder(uri, "image/png").setExternalUri(exuri)
        .setMetaData("{ \"image\" : \"trees\" }")
        .build();

但是需要第一个 URI,所以我无法共享 externalURI,因为它总是共享第一个 URI。有什么想法吗?

扩展url指定的内容必须与url指定的内容完全一致。 我在 Android Facebook SDK 源代码中找到了它。

An external URI that Messenger can use to download the content on Facebook's servers instead of requiring the Messenger application to upload the content. The content returned by the this URI must be exactly the same as the content specified by {@link #uri}. If the content is different, Messenger may fail to send the content. See <a href="https://developers.facebook.com/docs/messenger/android">developer docs</a> for more info.