所以我有一個簡單的登錄按鈕,這是否在我的OnCreate:的Android SDK的Facebook 3.0 SSO LoginButton返回一個空GraphUser
mLoginButton = (LoginButton)findViewById(R.id.connect_facebook_button);
mLoginButton.setApplicationId(.getResources().getString(R.string.app_id));
mLoginButton.setUserInfoChangedCallback(new LoginButton.UserInfoChangedCallback() {
public void onUserInfoFetched(GraphUser user) {
setUser(user); // Just sets mUser to be this user
try {
Toast.makeText(this, mUser.getFirstName(), Toast.LENGTH_SHORT).show();
} catch (Exception FacebookException) {
FacebookException.printStackTrace();
}
}
});
所有這一切都被成功調用,包括onUserInfoFetched。
的問題是,在每種情況下,我Graphuser用戶爲空。
我的appid是正確的,我的Android散列調試一個,他們給我(在示例應用程序測試工作得很好),登錄屏幕不實際彈出...不是真的知道在哪裏可以從這裏走。
而且,如果我打的按鈕兩次,我得到一個錯誤:
an attempt was made to open a session that has a pending request
的代碼看起來不錯,當我用你的代碼,我可以得到GraphUser信息。 HelloFacebookSample是否適合您,您可以看到登錄用戶的信息? –