Android Facebook SDK 4.0 - Display username -
i've been having little trouble migrating fb sdk's new version.
according documentation, how fetch default user data:
graphrequest request = graphrequest.newmerequest( accesstoken, new graphrequest.graphjsonobjectcallback() { @override public void oncompleted( jsonobject object, graphresponse response) { // application code } }); bundle parameters = new bundle(); parameters.putstring("fields", "id,name,link"); request.setparameters(parameters); request.executeasync();
and believe data contained withing jsonobject. however, not know how can access , use user data.
any extremelly appreciated!
thanks!
now facebook sdk 4.0 doesnt return graphuser returns pure json object while working around android app found someof tags. check this
{"id":"10000700xxxxxxx","birthday":"xx\/xx\/xxxx","email":"xxxxxx@gmail.com","first_name":"xxx","gender":"male","last_name":"xxxxx","link":"http:\/\/www.facebook.com\/10000700xxxxxxx","location":{"id":"1064427060xxxxx","name":"xxxx, xxxxxxxxxxx"},"locale":"en_us","name":"xxx xxxxx","timezone":5.5,"updated_time":"2015-03-27t13:33:02+0000","verified":true} ************************************* public void oncompleted(jsonobject user, graphresponse response) { string id = user.optstring("id"); string firstname = user.optstring("first_name"); string lastname = user.optstring("last_name"); , on...
Comments
Post a Comment