When I am trying to login to facebook from my native android app, I am able to log in and my session object is also "OPENED". But I am getting the user object as null. And in the response, I am getting the following error :
{HttpStatus: -1, errorCode: -1, errorType: null, errorMessage: java.lang.SecurityException: Permission denied (missing INTERNET permission?)}
Following is the code snippet :
private void onSessionStateChange(final Session session, SessionState state, Exception exception) {
if (state.isOpened()) {
Request request = Request.newMeRequest(session, new Request.GraphUserCallback() {
@Override
public void onCompleted(GraphUser user, Response response) {
// TODO Auto-generated method stub
if (session == Session.getActiveSession()) {
if (user != null) {
String user_ID = user.getId();//user id
String profileName = user.getName();//user's profile name
}
}
}
});
Request.executeBatchAsync(request);
} else if (state.isClosed()) {
Log.i(TAG, "Logged out...");
}
}
Please help.