我正在尝试使用Facebook SDK v3.18通过FacebookDialog分享链接。发布时收到此错误:(#100)无效的fbid。 这是我在我的应用中使用的代码:
private UiLifecycleHelper uiHelper;
...
uiHelper = new UiLifecycleHelper(this, null);
uiHelper.onCreate(savedInstanceState);
...
@Override
protected void onResume() {
super.onResume();
uiHelper.onResume();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
uiHelper.onSaveInstanceState(outState);
}
@Override
public void onPause() {
super.onPause();
uiHelper.onPause();
}
@Override
public void onDestroy() {
super.onDestroy();
uiHelper.onDestroy();
}
...
FacebookDialog shareDialog = new FacebookDialog.ShareDialogBuilder(HorizontalViewPagerCreator.this)
.setApplicationName("My app name")
.setLink("http://www.facebook.com")
.build();
uiHelper.trackPendingDialogCall(shareDialog.present());
这是我在Manifest中添加的元数据:
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id"/>