ios - Parse Json from Facebook -


i have been trying integrate facebook sdk login user's data. i'm using method after authentication user's details.

if ([fbsdkaccesstoken currentaccesstoken]) {     [[[fbsdkgraphrequest alloc] initwithgraphpath:@"me" parameters:nil]      startwithcompletionhandler:^(fbsdkgraphrequestconnection *connection, id result, nserror *error) {          if (!error) {              nslog(@"fetched user:%@", result);          }      }]; } 

and data i'm getting :

2015-07-08 14:02:40.502 auth-app[whatever] fetched user:{     "first_name" = lol;     gender = male;     id = 12345;     "last_name" = ak;     link = "https://www.facebook.com/...../....";     locale = "en_us";     name = "lol ak";     timezone = 4;     "updated_time" = "2015-07-08t10:22:32+0000";     verified = 1; } 

i need read array , display in text fields. tried using results[0] first element in array didn't work.

try way access data dictionary

nslog("%@",[result objectforkey:@"id"]); nslog("%@",[result objectforkey:@"first_name"]); nslog("%@",[result objectforkey:@"name"]); 

same read fields(key/value) pairs. , set textfields


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -