java - Android Facebook Graph API JSON returns no email -
i'm having issues trying obtain user's email via graphuser api object.
i managed obtain firstname, lastname , else not email.
i've done research you'll need add permission obtain user's email (login email facebook, not xxx@facebook.com). i'm stuck! how do in android?
private class facebooklogindelegateimpl extends facebooklogindelegate { /* * optional callback method */ protected void oncompletedprogress(graphuser user, response response) { log.d("fb userid:", user.getid()); log.d("fb firstname:", user.getfirstname()); log.d("fb lastname:", user.getlastname()); log.d("object:", user.tostring()); log.d("response:", response.tostring()); //log.d("fb email:", (string) user.asmap().get("email")); string userid = user.getid(); string firstname = user.getfirstname(); string lastname = user.getlastname(); string email= ""; try { email = user.getinnerjsonobject().getstring("email"); } catch (jsonexception e) { // todo auto-generated catch block e.printstacktrace(); } log.d("fb email:", email); loginactivity.this.requestfacebooklogin(userid, firstname, lastname); //string stringdata = "{\"id\":\""+user.getid()+"\",\"name\":\""+user.getname()+"\"}"; }
are sure user has set email default facebook one? facebook forces have email , need go in , change in order have one.
Comments
Post a Comment