facebook身份验证期间的空白页

时间:2011-12-06 17:20:24

标签: android authentication facebook

我在facebook身份验证中获得空白页:

http://i43.tinypic.com/2u9391d.png - 就像这样

我正在使用facebook API和我的身份验证码:

public void facebookAuthorize(){
    myPrefs = getPreferences(MODE_PRIVATE);
    String access_token = myPrefs.getString("access_token", null);
    long expires = myPrefs.getLong("access_expires", 0);

    if(access_token != null) {
        facebook.setAccessToken(access_token);

    }
    if(expires != 0) {
        facebook.setAccessExpires(expires);
    }

    /*
     * Only call authorize if the access_token has expired.
     */
    if(!facebook.isSessionValid()) {

        facebook.authorize(this, new String[] { "publish_stream", "read_stream", "offline_access" }, new DialogListener() {
            @Override
            public void onComplete(Bundle values) {
                SharedPreferences.Editor editor = myPrefs.edit();
                editor.putString("access_token", facebook.getAccessToken());
                editor.putLong("access_expires", facebook.getAccessExpires());
                editor.commit();
            }

            @Override
            public void onFacebookError(FacebookError error) {}

            @Override
            public void onError(DialogError e) {}

            @Override
            public void onCancel() {}
        });
    }
}

如何解决?

2 个答案:

答案 0 :(得分:0)

您是否在Facebook应用页面上添加了应用签名? Facebook Android Tutorial Link

答案 1 :(得分:0)

您确定在Facebook应用页面上正确添加了应用程序域(不是localhost)吗?