未安装应用时,Facebook Android SDK 3.22连接失败

时间:2015-10-27 09:38:48

标签: android facebook-sdk-3.0

我目前在连接时面临Facebook SDK 3.22的一些问题:

我的Facebook实例:

private Facebook mFacebook = new Facebook(BuildConfig.FACEBOOK_APPLICATION_ID);

授权电话:

mFacebook.authorize(this,  new String[]{ "email", "user_birthday",  "user_friends"}, new Facebook.DialogListener() {

        @Override
        public void onCancel() {
            Log.d(TAG, "Facebook cancel");
        }

        @Override
        public void onComplete(Bundle values) {
            //DO SOME STUFF
        }

        @Override
        public void onError(DialogError error) {
        }

        @Override
        public void onFacebookError(FacebookError fberror) {
        }
 });

我的回调活动:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    mFacebook.authorizeCallback(requestCode, resultCode, data);
}

当Facebook应用程序安装在设备上时,一切正常。如果不是应用程序崩溃该消息:

E/AndroidRuntime: android.content.res.Resources$NotFoundException:   String resource ID #0xffffffff
E/AndroidRuntime:     at android.content.res.Resources.getText(Resources.java:254)
E/AndroidRuntime:     at android.content.res.Resources.getString(Resources.java:340)
E/AndroidRuntime:     at android.content.Context.getString(Context.java:343)
E/AndroidRuntime:     at com.facebook.widget.WebDialog.onCreate(Unknown Source)
E/AndroidRuntime:     at android.app.Dialog.dispatchOnCreate(Dialog.java:361)
E/AndroidRuntime:     at android.app.Dialog.show(Dialog.java:262)
E/AndroidRuntime:     at com.facebook.AuthorizationClient$WebViewAuthHandler.tryAuthorize(Unknown Source)
E/AndroidRuntime:     at com.facebook.AuthorizationClient.tryCurrentHandler(Unknown Source)
E/AndroidRuntime:     at com.facebook.AuthorizationClient.tryNextHandler(Unknown Source)
E/AndroidRuntime:     at com.facebook.AuthorizationClient.authorize(Unknown Source)
E/AndroidRuntime:     at com.facebook.AuthorizationClient.startOrContinueAuth(Unknown Source)
E/AndroidRuntime:     at com.facebook.Session.tryLegacyAuth(Unknown Source)
E/AndroidRuntime:     at com.facebook.Session.authorize(Unknown Source)
E/AndroidRuntime:     at com.facebook.Session.open(Unknown Source)
E/AndroidRuntime:     at com.facebook.Session.openForPublish(Unknown Source)
E/AndroidRuntime:     at com.facebook.android.Facebook.openSession(Unknown Source)
E/AndroidRuntime:     at com.facebook.android.Facebook.authorize(Unknown Source)
E/AndroidRuntime:     at com.facebook.android.Facebook.authorize(Unknown Source)

我想说的最后一点是,目前无法升级到Facebook SDK 4(由于项目限制)。

非常感谢你的帮助。

0 个答案:

没有答案