I am trying to register in my iOS application via facebook SDK
I use FBSDKLoginManager to login to facebook, from which I get the AccessToken, which I checked.
https:
I received the name and ID in response, but I need to get an email and to register on Qiuckblox .
I downloaded the q-municate application (based on quickblox.com) from github and checked the token.
I have the same tokens, but the result is different. How so? Maybe I need to set some settings in facebook?
FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
[login logOut];
[login logInWithReadPermissions:@[@"email", @"public_profile", @"user_friends"]
fromViewController:self handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
if (error) {
NSLog(@"%@",error.localizedDescription);
}
else if (result.isCancelled) {
}
else {
NSLog(@"%@",result.token.tokenString);
if ([result.grantedPermissions containsObject:@"email"]) {
NSLog(@"Granted all permission");
if ([FBSDKAccessToken currentAccessToken]) {
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:@{@"fields": @"id, name, link, first_name, last_name, picture.type(large), email, birthday, bio ,location ,friends ,hometown , friendlists"}] startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
if (!error) {
NSLog(@"%@",result);
}
}];
}
} else {
NSLog(@"Not granted");
}
}
}];
here are the screenshots:
http://screencast.com/t/9KNK9HIb
http://screencast.com/t/BDsfYVZi