I am getting error as while launching my sampe code as "facebook.FacebookException: Unable to refresh the Access Token".What does that mean?
Code that i used is
String NEXT_URL = "http://www.facebook.com/connect/login_success.html";
String APPLICATION_ID = "140793189321103";
String[] PERMISSIONS = Facebook.Permissions.USER_DATA_PERMISSIONS;
ApplicationSettings as = new ApplicationSettings(NEXT_URL, APPLICATION_ID, PERMISSIONS);
Facebook fb = Facebook.getInstance(as);
try{
if(fb!=null)
try {
User user = fb.getCurrentUser();
System.out.println("UserClass"+user.getFirstName());
} catch (FacebookException e) {
System.out.println("FaceBookException"+e);
e.printStackTrace();
}
else{
System.out.println("FaceBook not connected");
}
}catch(Exception e){}
开发者_如何学Go // TODO Auto-generated catch block
}
I am getting access token as null,how can i get the particular user account initially?
Regards Rakesh Shankar.
instead of using User user = fb.getCurrentUser();
try this user = fb.getUser("me");
and also set all needed permission before instantiating Facebook class object
using ApplicationPermissionManager ApplicationPermission classes
精彩评论