Last active
December 11, 2015 02:39
-
-
Save pizthewiz/4532416 to your computer and use it in GitHub Desktop.
starting with version 3.1 (possibly 3.0, but i've only tested on 3.1.1) the iOS Facebook SDK disables the in-app UIWebView modal dialog (FBDialog) to authenticate the user and instead only enables iOS 6 system, Facebook.app and Mobile Safari. this hack was found and tested by stepping through the Facebook SDK source and building it manually into…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GRITTY - force Facebook SDK 3.1+ to use in-app modal UIWebView for user authentication | |
@implementation FBSession (CLUAdditions) | |
- (void)HACKEDauthorizeWithPermissions:(NSArray*)permissions behavior:(FBSessionLoginBehavior)behavior defaultAudience:(FBSessionDefaultAudience)audience isReauthorize:(BOOL)isReauthorize { | |
objc_msgSend(self, @selector(authorizeWithPermissions:defaultAudience:integratedAuth:FBAppAuth:safariAuth:fallback:isReauthorize:), permissions, audience, NO, NO, NO, YES, isReauthorize); | |
} | |
+ (void)load { | |
method_exchangeImplementations(class_getInstanceMethod(self, @selector(authorizeWithPermissions:behavior:defaultAudience:isReauthorize:)), class_getInstanceMethod(self, @selector(HACKEDauthorizeWithPermissions:behavior:defaultAudience:isReauthorize:))); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
using the objective-c runtime to swap implementations instead of just a category leaves things less ambiguous.