我正在尝试使用 SDK v3.6 ShareDialog 将图像发布到 Facebook。
结果我得到了 com.facebook.FacebookException: Error retrieving image attachment.
我就像医生说的那样:
private void ShareDialog(){
OpenGraphAction action = GraphObject.Factory.create(OpenGraphAction.class);
//action.setProperty("game", "https://example.com/cooking-app/meal/Lamb-Vindaloo.html");
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.icon);
List<Bitmap> images = new ArrayList<Bitmap>();
images.add(bitmap);
FacebookDialog shareDialog = new FacebookDialog.OpenGraphActionDialogBuilder(this, action, "cooking-app:cook", "game")
.setImageAttachmentsForAction(images, true)
.build();
uiHelper.trackPendingDialogCall(shareDialog.present());
}
而且我知道我需要添加 <provider android:authorities="com.facebook.app.NativeAppCallContentProvider{Facebook-app-id}"
android:name="com.facebook.NativeAppCallContentProvider" />
在 AndroidManifest.xml 中,但是当我这样做时,有一个错误代码,Multiple annotations found at this line:
- Tag <provider> attribute authorities has invalid character '{'.
- Exported content providers can provide access to potentially sensitive
data
如何正确添加提供者?
最佳答案
在您的 provider
定义中,它说 {Facebook-app-id}
您必须填写 Facebook 提供给的应用程序 ID。
关于android - 从 Facebook android SDK 中的 native ShareDialog 发布照片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21227559/