Skip to content

Instantly share code, notes, and snippets.

@adaptivedev
Created August 19, 2014 15:38
Show Gist options
  • Save adaptivedev/98c14e620da13361e9aa to your computer and use it in GitHub Desktop.
Save adaptivedev/98c14e620da13361e9aa to your computer and use it in GitHub Desktop.
Cordova-Facebook plugin issue solved: FBSessionStateClosedLoginFailed
JZN's answer here helped me (and I had to comment out the plugin's function "openURL")
http://stackoverflow.com/questions/12661104/ios6-facebook-integration-login-always-fbsessionstateclosedloginfailed-never-ope
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
return [FBSession.activeSession handleOpenURL:url];
}
/*
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
return [FBSession.activeSession handleOpenURL:url];
}
*/
/*
// this happens while we are running ( in the background, or from within our own app )
// only valid if Booster-Info.plist specifies a protocol to handle
- (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation
{
if (!url) {
return NO;
}
// calls into javascript global function 'handleOpenURL'
NSString* jsString = [NSString stringWithFormat:@"handleOpenURL(\"%@\");", url];
[self.viewController.webView stringByEvaluatingJavaScriptFromString:jsString];
// all plugins will get the notification, and their handlers will be called
[[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
return YES;
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment