Hi,
For last 6 months I have used a standard code for easyFacebookLogin and it worked fine. Yesterday I logged out and when I tried to sign in again I was directed to this page:
"https://api.backendless.com/v1/users/social/facebook/authorize/AF8A86A4-7119-38E0-FF83-2B15A0076E00?code=AQDLMzzs1sZQiaG3c57cHeJy6AoCMo-Zi8exS71OYS2msMxgFQUNCmz3c0uMrg0GFoHZV5Qapyxy0mq7Avd3RsuwrrX8QSECeFw7a_Ye-8KcbReCLyRQmVoAaid9RTPTn9FQoLzWElUZd_hVTRSJEwlVpOM7PXfmZ_PMoT_O4pOB0s0xDnLGFZHeSXa9jIIC64xGO59ydfHNxPRxxdOVTt3kZes7lIM9IIAZPsNPi8gTAjad08138I62_beMs0qyvciB0czn48ibMIclgMv5sl0qlwVtOOfHMIbdZvQiEASbAQwx6HP9BH5WXGl70U7bGO0NGDbQtOvQomtHNxY-r2Cp&state=455230716#_=_"
which said “Could not approve social account.”. I haven’t changed anything in my login code so I guess something must have happened on facebook’s or Your side. I tried to change permissions or field mapping dictionary but it didn’t work. Although I cannot log in, if I try it with a new account I see in Backendless console a new user is successfully registered, so the field mapping seems to works fine. Here’s the code I use for logging in:
-(void)facebookLogin{
[backendless.userService easyLoginWithFacebookFieldsMapping:
@{@"id" : @"facebookId",
@"email" : @"facebookMail",
@"first_name" : @"name",
@"last_name" : @"surname"}
permissions:@[@"email", @"public_profile"] response:^(NSNumber * number) {
[DataContainer sharedInstance].tempObject = self;
} error:^(Fault *fault) {
UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:@"Error" message:fault.description delegate:nil cancelButtonTitle:@"ok" otherButtonTitles: nil];
[alertView show];
}];
}
How can I fix it ?
Hi, Bartek!
Do you use default Facebook App settings or provided yours?
You can also try give a look at our Facebook Login JS Sample (download it in Backendless Console)
Since it is working fine I assume there should be something wrong with your code.http://image.prntscr.com/image/448a5e53d811485ca979bcbc55f2b1a7.png</img>:
I don’t use the default settings instead I configured my app according to this tutorial:
https://backendless.com/documentation/manage/mgmt_social_settings.htm
How is the Javascript sample code applicable to my iOS app ?
Hi Bartek,
we have deployed a server-side fixes, so you could update the latest Backendless SDK and check your app again.
Regards,
Stanislaw
We have deployed the server-side fixes, so you could update the latest Backendless SDK (pod 3.0.32 release), and check your app again.
Are those updates available in downloadable SDKs on your website ? as I don’t use cocoapods in this project.
Now you could get the latest Backendless SDK also from ios-SDK github (CommLibiOS and backendless libs).
Unfortunately nothing changed after the update. I haven’t changed any login-connected code or setting in months and previously it worked fine.
Ok so I guess something did change. Before the update I did receive a BackendlessUser object from handleURL method but with NULL properties. Now i get an error. (still the procedure successfully registers a new user with easyFacebookLogin but doesn’t log me in, tested on many FB accounts). The error says: “No value for key in object around character 12”. Full log:
Crumbler[657:156604] UserService -> easyLoginResponder: 'https://www.facebook.com/dialog/oauth/?client_id=1009200319154000&redirect_uri=[url=https://api.backendless.com/v1/users/social/facebook/authorize/AF8A86A4-7119-38E0-FF83-2B15A0076E00&scope=public_profile&state=2137294053]https://api.backendless.com/v1/users/social/facebook/authorize/AF8A86A4-7119-38E0-FF83-2B15A0076E00&scope=public_profile&state=2137294053[/url]' -> 'https://www.facebook.com/dialog/oauth/?client_id=1009200319154000&redirect_uri=[url=https://api.backendless.com/v1/users/social/facebook/authorize/AF8A86A4-7119-38E0-FF83-2B15A0076E00&scope=public_profile&state=2137294053]https://api.backendless.com/v1/users/social/facebook/authorize/AF8A86A4-7119-38E0-FF83-2B15A0076E00&scope=public_profile&state=2137294053[/url]'
2016-07-25 14:33:44.034667 Crumbler[657:156604] UserService -> handleOpenURL: url = 'backendlessaf8a86a4-7119-38e0-ff83-2b15a0076e00://%7B%22lastLogin%22#_=_'
2016-07-25 14:33:44.034800 Crumbler[657:156604] UserService -> handleOpenURL: JSONObject = '{"lastLogin"#_=_'
2016-07-25 14:33:44.034982 Crumbler[657:156604] UserService -> handleOpenURL: ERROR = Error Domain=NSCocoaErrorDomain Code=3840 "No value for key in object around character 12." UserInfo={NSDebugDescription=No value for key in object around character 12.}
Please try to login with your account using the attached project, then provide a log.
TestEasyLogin.zip (19.57MB)
I’ll try it but I already migrated to facebook login with FBSDK.
We fixed this issue on the server side, you can check again.