从Facebook的Android SDK中的本地ShareDialog发布照片 [英] Posting photo from a native ShareDialog in Facebook android SDK
问题描述
我想用SDK V3.6 ShareDialog张贴到Facebook的图像。
I am trying to post an image to the Facebook using SDK v3.6 ShareDialog.
因此,我得到了com.facebook.FacebookException:错误检索图片附件
As a result I got 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());
}
我知道我需要添加&LT;供应商的android:当局={com.facebook.app.NativeAppCallContentProvider实-APP-ID}
在AndroidManifest.xml中,但我这样做的时候,有一个错误code,找到
机器人:名字=com.facebook.NativeAppCallContentProvider/&GT; 多个注释在这一行:
- 标签&lt;提供商GT;属性机构有无效字符'{'。
- 出口的内容提供商可以访问潜在的敏感
数据
And I know I need to add <provider android:authorities="com.facebook.app.NativeAppCallContentProvider{Facebook-app-id}"
android:name="com.facebook.NativeAppCallContentProvider" />
in AndroidManifest.xml, but when I did this, there is an error code, Multiple annotations found at this line:
- Tag <provider> attribute authorities has invalid character '{'.
- Exported content providers can provide access to potentially sensitive
data
如何正确添加提供程序?
How to add a provider correctly?
推荐答案
在你的提供商
的定义,它说: {Facebook的-APP-ID }
你必须填写在被Facebook所提供的应用程序ID。
In your provider
definition, where it says {Facebook-app-id}
you have to fill in the app id provided to by Facebook.
这篇关于从Facebook的Android SDK中的本地ShareDialog发布照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!