Skip to content
Browse files

Unless the server indicates a "service_disabled_use_browser" error, f…

…allback to the inline authentication dialog in -[Facebook handleOpenURL:]
  • Loading branch information...
1 parent c83bcaa commit 74ae9527cb82663911973fc6286e142928af92ce @FunkeeMonk FunkeeMonk committed
Showing with 12 additions and 13 deletions.
  1. +12 −13 src/Facebook.m
View
25 src/Facebook.m
@@ -312,18 +312,18 @@ - (BOOL)handleOpenURL:(NSURL *)url {
if (!accessToken) {
NSString *errorReason = [params valueForKey:@"error"];
- // If the error response indicates that we should try again using Safari, open
- // the authorization dialog in Safari.
- if (errorReason && [errorReason isEqualToString:@"service_disabled_use_browser"]) {
- [self authorizeWithFBAppAuth:NO safariAuth:YES];
- return YES;
- }
-
- // If the error response indicates that we should try the authorization flow
- // in an inline dialog, do that.
- if (errorReason && [errorReason isEqualToString:@"service_disabled"]) {
- [self authorizeWithFBAppAuth:NO safariAuth:NO];
- return YES;
+ if (errorReason) {
+ // If the error response indicates that we should try again using Safari, open
+ // the authorization dialog in Safari.
+ if ([errorReason isEqualToString:@"service_disabled_use_browser"]) {
+ [self authorizeWithFBAppAuth:NO safariAuth:YES];
+ }
+ // Any other error response indicates that we should try the authorization flow
+ // in an inline dialog
+ else {
+ [self authorizeWithFBAppAuth:NO safariAuth:NO];
+ }
+ return YES;
}
// The facebook app may return an error_code parameter in case it
@@ -346,7 +346,6 @@ - (BOOL)handleOpenURL:(NSURL *)url {
expirationDate = [NSDate dateWithTimeIntervalSinceNow:expVal];
}
}
-
[self fbDialogLogin:accessToken expirationDate:expirationDate];
return YES;
}

0 comments on commit 74ae952

Please sign in to comment.
Something went wrong with that request. Please try again.