-canOpenURL: failed for URL: "fbauth2:/" (OSStatus error -10814.)" - ios

i'm adding Facebook and Google signup in my application but i have this issue
The operation couldn’t be completed. -10814
in the Facebook login and i don't know how to solve it, this is my app delegate code for the openUrl:
func application(_ application: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any])
-> Bool {
if let fbSDKAppId = FBSDKSettings.appID(), url.scheme!.hasPrefix("fb\(fbSDKAppId)"), url.host == "authorize" {
var shouldOpen :Bool = FBSDKApplicationDelegate.sharedInstance().application(application, open: url, sourceApplication:options[UIApplicationOpenURLOptionsKey.sourceApplication] as! String!,annotation:options[UIApplicationOpenURLOptionsKey.annotation])
return shouldOpen
}
else {
return GIDSignIn.sharedInstance().handle(url,
sourceApplication:options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String,
annotation: [:])
}
}
what i can do?

now I used the latest SDK v4.26.0 downloaded from here and I followed the link for steps to install for FB. and my code is
FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
if ([[[UIDevice currentDevice] systemVersion] floatValue] <= 9) {
// After iOS9 we can not use it anymore
login.loginBehavior = FBSDKLoginBehaviorSystemAccount;
} else {
login.loginBehavior = FBSDKLoginBehaviorWeb;
}
NSArray *permission = [[NSArray alloc] initWithObjects:#"email",#"public_profile",#"user_friends", nil];
NSLog( #"### running FB sdk version: %#", [FBSDKSettings sdkVersion] );
[login logInWithReadPermissions:permission fromViewController:(UIViewController *)self handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
[self removeActivityIndicatorWithBg:activityIndicator];
if (error) {
NSLog(#"Process error");
} else if (result.isCancelled) {
NSLog(#"Cancelled");
} else {
NSLog(#"Logged in%#",result.grantedPermissions);
}
}];
here i used the login behavior as FBSDKLoginBehaviorSystemAccount and I get the error as
(- error: "The operation couldn’t be completed. -10814)
so in my simulator or device contains no accounts setup in system settings for facebook. then it comes on the following block
if (error) {
NSLog(#"Process error");
}
if I print the error,
No Facebook account.
There are no Facebook accounts configured. You can add or create a Facebook account in Settings.
so I changed the loginBehavior from FBSDKLoginBehaviorSystemAccount to FBSDKLoginBehaviorWeb, I got all OP with out error

Worked after adding openUrl with options:
Facebook documentation
Note that application:openURL:options: is only available in iOS 9 and above. If you are building with an older version of the iOS SDK, you can use:
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
BOOL handled = [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation
];
// Add any custom logic here.
return handled;
}

LSApplicationQueriesSchemes property set in info.plist has solved the problem for me.
Check attached screenshot:

In this thread you can find an issue and a temporary fix for such kind of error.

Related

'user' is always nil in logInInBackgroundWithReadPermissions in Parse iOS SDK

I'm using Facebook SDK with Parse SDK in user Login.
Using 'logInInBackgroundWithReadPermissions' to perform login, Even though user is authenticated the app, 'user' is always nil in the response. And error is:
Error Domain=com.facebook.sdk.login Code=304 "The operation couldn’t
be completed. (com.facebook.sdk.login error 304.)"
Here is my Implementation:
• Basic configuration:
I have configured every thing in .plist
and followed guidelines at link1, link2
• Imported frameworks:
• Implementation in Appdelegate:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[Parse setApplicationId:#"I have used real key here" clientKey:#"I have used real key here"];
[PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:launchOptions];
return YES; }
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
return [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation];
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
[FBSDKAppEvents activateApp];
}
• Login Implementation:
NSArray *fbPermissions = [[NSArray alloc] initWithObjects: #"public_profile", nil];
[PFFacebookUtils logInInBackgroundWithReadPermissions:fbPermissions block:^(PFUser *user, NSError *error) {
if (!user) {
NSLog(#"Uh oh. The user cancelled the Facebook login.");
}
else if (user.isNew) {
NSLog(#"User signed up and logged in through Facebook!");
} else {
NSLog(#"User logged in through Facebook!");
}
}];
But in the call back, 'user' is always nil. Did anyone face the same issue?
- Thanks in advance.
I was not able to find out cause for the issue. But I just deleted all frameworks related to Parse and Facebook and Re-added all of them. It worked fine. So, there is no issue in the code.
in AppDelegate.m file, under didFinishLaunchingWithOptions method, initialize Parse before initializing PFFacebookUtils.

FBSDKSharingDelegate callback not working, even when post works fine

FBSDKSharingDelegate callback is not working. I can post to facebook fine with the ios SDK, but I'd like to detect if the post was successful and take additional action to notify the user. However, the callback is not working for me. The delegate methods are not being called and I don't know why.
Using ios8, Parse as my backend. In Parse, the user is linked to FB. I'm using the IOS simulator.
What I've tried:
I've ensured that publish permissions are granted, saved, and linked to the Parse user. I've run a check and "publish_actions" are detected OK. The posting works fine as I can see the post on the facebook account. It's just the callback that is not working. I've checked my fb setup and it looks fine. For good measure at the very bottom I've included that relevant code from my app delegate. I've blocked out confidential keys with XXXX.
Code:
1st: See if user is logged in to Parse, if not, send to sign in and link to facebook account. Once that is done, I request "publish" permissions and link that additional permission to the Parse user. I know this works b/c when I recompile, it remembers the "publish" permissions and goes right to into the post.
#interface FacebookAPIPost () <FBSDKSharingDelegate>
#end
#implementation FacebookAPIPost
-(void)shareSegmentFacebookAPI { //if statement below
//1) logged in?, if not send to sign up screen
//2) else if logged in, link account to facebook account, then send post
//3) else send to post b/c signed up and linked already.
PFUser *currentUser = [PFUser currentUser];
if(!currentUser) {
[self pushToSignIn];
} else if(![PFFacebookUtils isLinkedWithUser:currentUser]){
[self linkUserToFacebook:currentUser];
NSLog(#"user account not linked to facebook");
} else {
[self shareSegmentWithFacebookComposer];
}
}
-(void)linkUserToFacebook:currentUser{
[PFFacebookUtils linkUserInBackground:currentUser withPublishPermissions:#[#"publish_actions"] block:^(BOOL succeeded, NSError *error) {
if(error){
NSLog(#"There was an issue linking your facebook account. Please try again.");
}
else {
NSLog(#"facebook account is linked");
//Send the facebook status update
[self shareSegmentWithFacebookComposer];
}
}];
}
-(void)shareSegmentWithFacebookComposer{
if ([[FBSDKAccessToken currentAccessToken] hasGranted:#"publish_actions"]) {
[self publishFBPost]; //publish
} else {
NSLog(#"no publish permissions"); // no publish permissions so get them, then post
[PFFacebookUtils linkUserInBackground:[PFUser currentUser]
withPublishPermissions:#[ #"publish_actions"]
block:^(BOOL succeeded, NSError *error) {
if (succeeded) {
NSLog(#"User now has read and publish permissions!");
[self publishFBPost];
}
}];
Here is where the post gets made:
-(void) publishFBPost{
FBSDKShareLinkContent *content = [FBSDKShareLinkContent new];
content.contentURL = [NSURL URLWithString:[self.selectedSegment valueForKey:#"linkToContent"]];
content.contentTitle = [self.selectedProgram valueForKey:#"programTitle"];
content.contentDescription = [self.selectedSegment valueForKey:#"purposeSummary"];
PFFile *theImage = [self.selectedSegment valueForKey:#"segmentImage"];
NSString *urlString = theImage.url;
NSURL *url = [NSURL URLWithString:urlString];
content.imageURL = url;
FBSDKShareDialog *shareDialog = [FBSDKShareDialog new];
[shareDialog setMode:FBSDKShareDialogModeAutomatic];
// [FBSDKShareDialog showFromViewController:self.messageTableViewController withContent:content delegate:self];
[shareDialog setShareContent:content];
[shareDialog setDelegate:self];
[shareDialog setFromViewController:self.messageTableViewController];
[shareDialog show];
}
Delegate methods below are not working. Meaning after the post is complete, I can see it on the FB account, but none of these delegate methods execute.
#pragma mark - delegate methods
- (void)sharer:(id<FBSDKSharing>)sharer didCompleteWithResults:(NSDictionary *)results {
// if ([sharer isEqual:self.shareDialog]) {
NSLog(#"I'm going to go crazy if this doesn't work.%#",results);
// Your delegate code
// }
}
- (void)sharer:(id<FBSDKSharing>)sharer didFailWithError:(NSError *)error
{
NSLog(#"sharing error:%#", error);
NSString *message = error.userInfo[FBSDKErrorLocalizedDescriptionKey] ?:
#"There was a problem sharing, please try again later.";
NSString *title = error.userInfo[FBSDKErrorLocalizedTitleKey] ?: #"Oops!";
[[[UIAlertView alloc] initWithTitle:title message:message delegate:nil cancelButtonTitle:#"OK" otherButtonTitles:nil] show];
}
- (void)sharerDidCancel:(id<FBSDKSharing>)sharer
{
NSLog(#"share cancelled");
}
Console output:
The only message I get back after posting is after a few seconds this message appears:
plugin com.apple.share.Facebook.post invalidated
Please help!
Footnote: appDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Initialize Parse.
[Parse enableLocalDatastore];
[Parse setApplicationId:#"XXXX"
clientKey:#"XXX"];
[PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:launchOptions];
//Initialize Facebook
[FBSDKAppEvents activateApp];
return [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
}
//Method added for facebook integration
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
return [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation];
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
[FBSDKAppEvents activateApp];
}
I think I am too late answering this question but someone else could trap into this as well, that's why sharing my knowledge.
As per Facebook API documentation
sharer:didCompleteWithResults: Sent to the delegate when the share completes without error or cancellation.
The results from the sharer. This may be nil or empty.
its probably because this delegate method is only get called when the post is successfully shared. In case of failure the other delegate method sharer:didFailWithError:get called. I think Facebook API should not need to add the result parameter is that case.
So in my experience if sharer:didCompleteWithResults whenever this is called that would mean success.

finishedWithAuth not called after authenticate method

I have already set the clientID ,scope and then on button click in MyViewController ,i am calling method login from LoginCLass which works but after [signIn authenticate] ,the delegate implementation finishedWithAuth is not getting called.I have set .h file as
- (NSError *) login
{
NSLog(#"In login :%# %# %#",kClientId,scopes,actions);
if(!kClientId|| !scopes)
{
NSLog(#"Either client ID Or scope is not specified!! ");
NSError *err=[[NSError alloc]initWithDomain:#"Scope not specified" code:0 userInfo:nil];
return err;
}
else
{
NSLog(#"Client ID and Scope are set.");
GPPSignIn *signIn = [GPPSignIn sharedInstance];
signIn.delegate = self;
signIn.shouldFetchGooglePlusUser = YES;
[signIn authenticate];
[signIn trySilentAuthentication];
return nil;
}
}
- (void)finishedWithAuth:(GTMOAuth2Authentication *)auth error:(NSError *)error
{
NSLog(#"Received error %# and auth object %#",error, auth);
}
and also in AppDelegate i am adding the code
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
return [GPPURLHandler handleURL:url
sourceApplication:sourceApplication
annotation:annotation];
}
I have checked the bundle ID and URL Types to be specified,they are set same as bundle ID from Google API access.
These methods are in LoginClass which are used in MyViewController class.
When i set the finishedWithAuth delegate to MyViewController ,by setting it as GPPSignInDelegate, the code runs fine.But, i want to use it from LoginClass.
Any idea , where am i going wrong ??
Since your LoginClass is a Swift class, the fix is to make it a subclass of NSObject.
I had the same issue: when I tried to set the delegate to a class that was not a subclass of NSObject, the assignment failed and the delegate remained nil. When I added NSObject as a superclass, the assignment worked as expected.
The problem seems to be where an instance of the GPPSignIn is not persisted between leaving the app to load Safari and coming back to your app.
Currently in your login method you have:
GPPSignIn *signIn = [GPPSignIn sharedInstance];
so this is a local instance variable. Try moving this to the class level:
#implementation LoginClass {
GPPSignIn *signIn;
}
then use that in your login method
You Can use
if (![signIn trySilentAuthentication])
[signIn authenticate];
Follow this link for more detail
trySilentAuthentication without Google+ button
This happened to me too in my apps running iOS 8. What did it for me was to set the clientId in the AppDelegate as soon as the app launched, and not in the viewDidLoad method of my UIViewController class as indicated in the Google+ Sign-in for iOS example in the following URL: https://developers.google.com/+/mobile/ios/sign-in
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
/
//Google+
// Set app's client ID for |GPPSignIn| and |GPPShare|.
[GPPSignIn sharedInstance].clientID = #"xxxxxx.......apps.googleusercontent.com";
...
return YES;
}
So, in your UIViewController class the sign-in method should be:
- (void)viewDidLoad {
[super viewDidLoad];
//Google+ for Logging in the user again if the app has been authorized
signIn = [GPPSignIn sharedInstance];
signIn.shouldFetchGooglePlusUser = YES;
signIn.shouldFetchGoogleUserID = YES;
signIn.shouldFetchGoogleUserEmail = YES;
signIn.scopes = #[ kGTLAuthScopePlusLogin ];
signIn.delegate = self;
[signIn trySilentAuthentication];
...
}
Here is the simple solution for this.
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
if (url.absoluteString.range(of: "oauth2callback") != nil) {
GPPSignIn.sharedInstance().handle(url, sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as! String, annotation: nil)
}
return false
}

Facebook iOS SDK Not Calling Completion Handler

Problem:
Using the FB SDK and the method openActiveSessionWithReadPermissions, the completion handler doesn't appear to get called when the app is reopened from Facebook web or Facebook app and I get this error output:
FBSDKLog: FBSession INVALID transition from FBSessionStateCreated to FBSessionStateClosed
FBSDKLog: FBSession transition from FBSessionStateCreated to FBSessionStateCreatedOpening
Context
Using Facebook SDK 3.2.1
App is built for iOS 5.0+
Using xCode 4.6.1
Testing on Simulator iOS 5.1
Testing on iPhone 4S, running iOS 6.1.2 (not using 6.0 social framework as want to test implementation for 5.0+)
Updating an app that was originally built for iOS 3.0 and using an old version of sharekit, but has now been updated for ARC and the share kit implementation I believe has all been commented out - hoping the issue is not a conflict with a old share kit function, can't fin any within the code
Steps taken to resolve
Searched throughout Stack Overflow, found similar issues mentioned but not a solution
ios6 facebook integration login always FBSessionStateClosedLoginFailed never opens (i already have bool:application implemented)
Facebook iOS SDK 3.0 - session not open
Facebook SDK 3.1 - Error validating access token
Have the correct app bundle in the FB settings panel
Have the correct Facebook app ID is the plist
Have FB logging turned on FBSettings setLoggingBehavior
Specifics:
These are the steps I took to implement Facebook connectivity within the app.
The first step I took was walking through the Facebook tutorial at: https://developers.facebook.com/docs/tutorials/ios-sdk-tutorial/. I got the first part, the authentication part working as expected (I built a separate app as instructed by the tutorial.)
I then took the same steps within the tutorial in the app I'm updating, this did not work
I then followed the instructions on https://developers.facebook.com/docs/howtos/login-with-facebook-using-ios-sdk/ (which are very similar to the tutorial)
Again I ran into issues
Then spent a lot of time searching for solution, could not find one
Highlevel steps in code:
I have my FB methods set up in AppDelegate
In a specific view controller I have a button that calls the openSessionWithAllowLoginUI method to start the login process
Code
AppDelegate.m
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
// set up facebook logging
[FBSettings setLoggingBehavior:[NSSet setWithObjects:FBLoggingBehaviorFBRequests, FBLoggingBehaviorFBURLConnections, FBLoggingBehaviorAccessTokens, FBLoggingBehaviorSessionStateTransitions, nil]];
// Call the ACAccountStore method renewCredentialsForAccount, which will update the OS's understanding of the token state
ACAccountStore *accountStore;
ACAccountType *accountTypeFB;
if ((accountStore = [[ACAccountStore alloc] init]) &&
(accountTypeFB = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook] ) ){
NSArray *fbAccounts = [accountStore accountsWithAccountType:accountTypeFB];
id account;
if (fbAccounts && [fbAccounts count] > 0 &&
(account = [fbAccounts objectAtIndex:0])){
[accountStore renewCredentialsForAccount:account completion:^(ACAccountCredentialRenewResult renewResult, NSError *error) {
//we don't actually need to inspect renewResult or error.
if (error){
}
}];
}
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
// We need to properly handle activation of the application with regards to Facebook Login
// (e.g., returning from iOS 6.0 Login Dialog or from fast app switching).
NSLog(#"Calling app did become active");
[FBSession.activeSession handleDidBecomeActive];
}
/*
* Callback for session changes.
*/
- (void)sessionStateChanged:(FBSession *)session
state:(FBSessionState) state
error:(NSError *)error
{
NSLog(#"Session State Changed");
switch (state) {
case FBSessionStateOpen:
if (!error) {
// We have a valid session
NSLog(#"User session found");
}
break;
case FBSessionStateClosed:
case FBSessionStateClosedLoginFailed:
[FBSession.activeSession closeAndClearTokenInformation];
break;
default:
break;
}
[[NSNotificationCenter defaultCenter]
postNotificationName:FBSessionStateChangedNotification
object:session];
if (error) {
UIAlertView *alertView = [[UIAlertView alloc]
initWithTitle:#"Error"
message:error.localizedDescription
delegate:nil
cancelButtonTitle:#"OK"
otherButtonTitles:nil];
[alertView show];
}
}
/*
* Opens a Facebook session and optionally shows the login UX.
*/
- (BOOL)openSessionWithAllowLoginUI:(BOOL)allowLoginUI {
NSLog(#"Openning session with Facebook");
return [FBSession openActiveSessionWithReadPermissions:nil
allowLoginUI:allowLoginUI
completionHandler:^(FBSession *session,
FBSessionState state,
NSError *error) {
[self sessionStateChanged:session
state:state
error:error];
}];
}
/*
* If we have a valid session at the time of openURL call, we handle
* Facebook transitions by passing the url argument to handleOpenURL
*/
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
// attempt to extract a token from the url
NSLog(#"Calling open URL");
return [FBSession.activeSession handleOpenURL:url];
}
- (void) closeSession {
NSLog(#"Clossing Facebook Sessions");
[FBSession.activeSession closeAndClearTokenInformation];
}
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
NSLog(#"handleOpenUrl Called");
return [FBSession.activeSession handleOpenURL:url];
}
View Controller with button
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
// Register for Facebook change notification
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:#selector(sessionStateChanged:)
name:FBSessionStateChangedNotification
object:nil];
}
- (IBAction)login:(id)sender {
ATIAppDelegate *myAppDelegate = (ATIAppDelegate *)[[UIApplication sharedApplication]delegate];
[myAppDelegate openSessionWithAllowLoginUI:YES];
}
What I think the issue could be?
It seems like it may be something with the tokens?
Or maybe the notification center?
Note that during testing I've been going and revoking access of the Facebook app to my account and then trying to login again to the app, I see these has caused issues with other users
Okay I figured it out - the issue was nothing to do with FB itself, the app (I'm working on updating someone else's code) had a setting in the .plist - 'Application does not run in background' set to true.
Meaning that once the app was relaunched from the Facebook app or Facebook mobile site it wasn't prepared to handle the next step.
If you don't want the app to run in the background, you can bind to the FBSDKApplicationDelegate in your AppDelegate like so:
import UIKit
import FBSDKLoginKit
#UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
}
func applicationWillResignActive(_ application: UIApplication) {
FBSDKAppEvents.activateApp()
}
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(application, open: url, sourceApplication: sourceApplication, annotation: annotation)
}
}
https://forums.developer.apple.com/thread/50332
http://ashishkakkad.com/tag/fbsdkapplicationdelegate/

black screen appears after facebook authenticates , facebook dialog not shown

i am integrating login through facebook in an ios app , in which during the app launch i show an alert to the user , and when the user clicks on the OK button on the alert view , then the FB login dialog is shown to the user .The problem is when i click on the home button and relaunch the app to show the alert, then after clicking on OK does not show the user the facebook login dialog. i have used the facebook ios sdk 3.0 and xcode 4.5 gm. *Interestingly when i kill the app from background every thing works fine.*below is the code in the app did finish launching for facebook
if (!self.session.isOpen)
{
NSArray *permissions = [[NSArray alloc] initWithObjects:
#"user_likes",
#"read_stream",#"publish_stream",#"email",
nil];
self.session = [[FBSession alloc] initWithPermissions:permissions];
if (self.session.state == FBSessionStateCreatedTokenLoaded)
{
// even though we had a cached token, we need to login to make the session usable
[self.session openWithCompletionHandler:^(FBSession *session,
FBSessionState status,
NSError *error) {
}];
}
}
this is the method i call when user clicks on the OK button on the alert view
-(IBAction) facebookLogin
{
if (self.session.isOpen)
{
[self.session closeAndClearTokenInformation];
}
else
{
if (self.session.state != FBSessionStateCreated) {
// Create a new, logged out session.
self.session = [[FBSession alloc] init];
}
[self.session openWithCompletionHandler:^(FBSession *session,
FBSessionState status,
NSError *error) {
if (error) {
NSLog(#"dex is %#",error.description);
}
}];
}
}
Follow this doc on Facebook developer.
It explains how to handle login and logout functionalities. Implement as it says, works perfectly. And also you can use the latest 3.1 sdk.
It's an old question, but anyway.
I had same behaviour when I didn't updated my AppDelegate. In swift it should look like this:
func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
}
func applicationWillResignActive(application: UIApplication) {
FBSDKAppEvents.activateApp()
}
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Some code was here
return FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
}

Resources