I'm developing an application in which I'm using Facebook
login for authentication and stuff. facebook sdk 3.0
needs some permission for accessing user data such as profile picture, emailID,publish_stram and etc. How to give permission in the code for accessing those things. Till now I'm able to get fb_access_token
. Here is my code:
Session.openActiveSession(this, true, new Session.StatusCallback() {
// callback when session changes state
@Override
public void call(Session session, SessionState state,
Exception exception) {
if (session.isOpened()) {
// make request to the /me API
Request.executeMeRequestAsync(session,
new Request.GraphUserCallback() {
// callback after Graph API response with
// user
// object
@Override
public void onCompleted(GraphUser user,
Response response) {
if (user != null) {
fb_user_id = user.getId();
}
Session session = Session
.getActiveSession();
if (session.isOpened()) {
access_token = session
.getAccessToken();
}
new postFBData().execute();
}
});
}
}
});
Taken this code snippet from Facebook samples. How to give permission before accessing access_token
from FB?
Any help will be appreciated.