ios - PFFacebookUtils loginWithPermissions errors first time, goes through the second -
So I'm working on the initial flow of my app, and my Facebook login is all bad now. After deleting all references to my user account in my database (parsed, then in the browser I have removed my installation and user object), and to remove my app permissions directly, I should be in a new one User's trend When they reached the clean state to start
I'd start the app, login page and tap the Facebook login. I get this error then:
Uh oh There was an error: Error Domain = com.facebook.sdk code = 5 "The operation could not be completed. (Com.facebook.sdk error 5.)" UserInfo = 0x14e848e0 {com.facebook.sdk: HTTPStatusCode = 400, com. Facebook.sdk: ParsedJSONResponseKey = {body = {error = {code = 190; "Error_subcode" = 458; Message = "Error validating access token: User has not authorized 578357495617589."; Type = OAuthException; }; }; Code = 400; Header = ({name = Connection; value = close;}, {name = expires; value = "Sat, 01 Jan 2000 00:00:00 GMT";}, {name = "cache-control"; value = "no Value = "no",}, {name = "content-type"}, {name = "access-control-allow-origin"; value = "*";}, {name = pragma; value = "no-cache "; Values =" text / javascript; charset = UTF-8 ";}, {name =" WWW-certify "; value =" OAuth "" Facebook Platform \ "\" invalid_token \ "\" Access token validating error: the user has not applied the authorized 578357495617589. \ "";});}, Com.facebook.sdk: ErrorSessionKey = & lt; FBSession: 0x14e4d710, state: FBSessionStateClosed, Loginhandlr: 0x0, Apiaidi: 578357495617589, urlSchemeSuffix :, Token caching dialog: & lt; pf FacebookTokenCachingStrategy: 0x14e4e820 & gt;, expiry date: (null), fresh Krentet: (null), try to refresh date: 000l-l2-30 00:00:00 +0000, permissions (empty)>)
On my phone, I have a rejected button, so I reject if I try again, then I have to give proper communication to Facebook permission. If I check in my database, a user is now built, but why have it been two attempts?
Here is my login code:
- (IBAction) loginButtonTouchHandler: (id) sender must set permissions {// Facebook user account NSArray * Anumtiyaare = @ [ @ "User_bout_me", @ "user_rellibes", @ "user_bridade", @ "user_location"]; NSLog (@ "Current User:% @", [PFUSSER Current User]); // Access using PFUser Facebook and [PFFacebookUtils logInWith chapter: Anumtiyaare block: ^ (PFUser * user, NSError * error) {[_activityIndicator stopAnimating]; // Hide the loading indicator if (! User) {if (error!) {NSLOG (@ "Uh oh; user canceled Facebook login."); UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @ "Login error" message: @ "Uh oh. The user has canceled Facebook login." Representative: zero cancellationTitil: zero other buttonlets: @ "dismiss", zero]; [Alerts show]; } Else {NSLog (@ "Uh oh. An error occurred:% @", error); UIAlertView * alert = [[UIAlertView Alloc] InitWithTitle: @ "Login Error" message: [Description of error] representatives: zero cancellation Krentutn: Other Btntn: @ "Terminate" zero]; [Alerts show]; }} And if (user.isNew) {NSLog (@ "User sign up and log in with Facebook!"); [Self-SetupBaby]; } Other {nslog (@ "log in to facebook with user!"); [Self-SetupBaby]; }}]; [_activityIndicator startAnimating]; // Show loading indicator until logging ends}
I have put some breakpoints in the code above, and when the block is executed for the first time, the user is zero, Still still trying to save him any thoughts about what the user object is going on?
Thanks
Comments
Post a Comment