android - facebook sample is not working -
i newbie facebook integration android apps. trying run app facebook getting started. not working. not getting user name. why not working? can me.
i got following 1 session variable.
session: {session state:opening, token:{accesstoken token:access_token_removed permissions:[]}, appid:360610310722942}
session opened: false
public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); // start facebook login session.openactivesession(this, true, new session.statuscallback() { // callback when session changes state @override public void call(session session, sessionstate state, exception exception) { final textview welcome = (textview) findviewbyid(r.id.welcome); system.out.println("session: " + session); system.out.println("session opened: " + session.isopened()); if (session.isopened()) { // make request /me api request.executemerequestasync(session, new request.graphusercallback() { // callback after graph api response user // object @override public void oncompleted(graphuser user, response response) { if (user != null) { welcome.settext("hello " + user.getname() + "!"); } } }); } } }); } @override public void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); system.out.println("onactivityresult"); session.getactivesession().onactivityresult(this, requestcode, resultcode, data); }
i have same issue , fix this. cause project in sandbox mode. disable sandbox mode , app works fine
Comments
Post a Comment