Get country name & timezone from facebook login in ios

413 views Asked by At

I am getting user data using FBSDKGraphRequest in facebook login from graph..

But don't know how to get timezone & only country name from that data..

what i coded till now is as follow:

FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                              initWithGraphPath:[NSString stringWithFormat:@"/%@",result.token.userID]
                              parameters:@{ @"fields" : @"id, name, email, first_name, hometown, last_name, location" }
                              HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
    [self handleRequestCompletionWithResult:result error:error];
}];

Here I am getting data in result ..!!!

1

There are 1 answers

1
Fahri Azimov On BEST ANSWER

I don't know about the country, but you can get the timezone by adding timezone to the fields. All the available fields can be found here: User graph API

BTW, location field should return the country.