0
你好,我試圖使用Facebook登錄。沒有Session.StatusCallback收到
我的問題是,我沒有得到回電。
這裏是我的代碼:
private void onClickLogin() {
Session currentSession = Session.getActiveSession();
if (currentSession == null || currentSession.getState().isClosed()) {
Session session = new Session.Builder(this).build();
Session.setActiveSession(session);
currentSession = session;
}
// Ask for username and password
OpenRequest op = new Session.OpenRequest((Activity) this);
op.setLoginBehavior(SessionLoginBehavior.SUPPRESS_SSO);
op.setCallback(null);
List<String> permissions = new ArrayList<String>();
// permissions.add("publish_actions");
permissions.add("user_photos");
permissions.add("friends_photos");
permissions.add("read_stream");
permissions.add("read_insights");
permissions.add("read_friendlists");
permissions.add("email");
permissions.add("publish_actions");
op.setPermissions(permissions);
Session session = new Session.Builder(this).build();
Session.setActiveSession(session);
session.openForPublish(op);
}
@Override
protected void onActivityResult(int requestCode, int resultCode,
Intent data2) {
Session.getActiveSession().onActivityResult(RegisterPage.this, requestCode, resultCode, data2);
}
rivate class SessionStatusCallback implements Session.StatusCallback {
@SuppressWarnings("deprecation")
@Override
public void call(final Session session, SessionState state,
Exception exception) {
Log.i("test", "test");
}
}