我正在使用 Facebook SDK,但我想创建相册,但我在会话中获得了 ACCESS_TOKEN_REMOVED。
在会话中得到这个
{Session state:OPENED, token:{AccessToken token:ACCESS_TOKEN_REMOVED permissions:[read_stream, manage_friendlists, read_mailbox, status_update, photo_upload, video_upload, sms, create_event, rsvp_event, email, xmpp_login, create_note, share_item, publish_stream, ads_management, read_insights, read_requests, manage_notifications, read_friendlists, manage_pages, publish_actions, user_birthday, user_religion_politics, user_relationships, user_relationship_details, user_hometown, user_location, user_likes, user_activities, user_interests, user_education_history, user_work_history, user_online_presence, user_website, user_groups, user_events, user_photos, user_videos, user_photo_video_tags, user_notes, user_checkins, user_about_me, user_status, basic_info]}, appId:458921577539675}
代码。
/**
* Connect to facebook using Facebook SDK.
*/
public void connectToFacebook() {
Session session = Session.getActiveSession();
if(session == null || session.isClosed()) {
Session.openActiveSession((Activity)context, true, new StatusCallback() {
@Override
public void call(Session session, SessionState state, Exception exception) {
if(session.isOpened() && state == SessionState.CREATED_TOKEN_LOADED) {
Log.v(GlobalVars.TAG, "Token::" + session.getAccessToken());
Request.executeMeRequestAsync(session, new GraphUserCallback() {
@Override
public void onCompleted(GraphUser user, Response response) {
if(response != null) {
Log.v(GlobalVars.TAG, "Response::" + response);
Log.v(GlobalVars.TAG, "Response::" + user.getFirstName() + ":::" + user.getLastName());
}
}
});
}
}
});
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
}