SDKBOX Facebook Login not working

SDKBOX Facebook Login not working
0

Hiya.

I’ve been trying to get facebook login to work on a new iOS project. On Android it works, but on iOS login does not trigger a popup.

When I press the button which triggers a login if the user is not logged in yet, the following events are triggered.

Events: [
  {
    "event" : {
      "4_error_code" : "",
      "_implicitlyLogged" : "1",
      "7_logging_token" : "",
      "_eventName" : "fb_mobile_login_start",
      "_logTime" : 1569424371,
      "1_timestamp_ms" : 1569424370870,
      "6_extras" : "{\"trySafariAuth\":true,\"login_behavior\":\"FBSDKLoginBehaviorBrowser\",\"permissions\":\"public_profile\",\"default_audience\":\"friends\",\"tryFBAppAuth\":false,\"isReauthorize\":false}",
      "_ui" : "RootViewController",
      "5_error_message" : "",
      "2_result" : "",
      "0_auth_logger_id" : "[Redacted]"
    },
    "isImplicit" : true
  },
  {
    "event" : {
      "4_error_code" : "",
      "_implicitlyLogged" : "1",
      "7_logging_token" : "",
      "_eventName" : "fb_mobile_login_method_complete",
      "_logTime" : 1569424371,
      "1_timestamp_ms" : 1569424370892,
      "6_extras" : "{\"isMessengerAppCanOpenURLSchemeRegistered\":true,\"isFacebookAppCanOpenURLSchemeRegistered\":true,\"isURLSchemeRegistered\":true,\"implicit_cancel\":true}",
      "_ui" : "RootViewController",
      "5_error_message" : "",
      "2_result" : "cancelled",
      "0_auth_logger_id" : "[Redacted]"
    },
    "isImplicit" : true
  },

The facebooklistener function ‘onLogin’ is also called. with a login status of FALSE and a message of ‘cancelled’.

SDKBOX import went without flaw, so I wonder if I’m missing something somewhere.

http://docs.sdkbox.com/en/plugins/facebook/v3-cpp/#setup-ios

#import <FBSDKCoreKit/FBSDKCoreKit.h>

- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

  //
  // **************************
  // !! IMPORTANT !!
  // **************************
  //
  // call [[FBSDKApplicationDelegate sharedInstance] application:didFinishLaunchingWithOptions
  // before app->run()

  [[FBSDKApplicationDelegate sharedInstance] application:application
    didFinishLaunchingWithOptions:launchOptions];

  app->run();

  return YES;
}

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
            options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {

  BOOL handled = [[FBSDKApplicationDelegate sharedInstance] application:application
    openURL:url
    sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
    annotation:options[UIApplicationOpenURLOptionsAnnotationKey]
  ];
  // Add any custom logic here.
  return handled;
}

- (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;
}

I copied the Facebook frameworks and PluginFacebook frameworks from the sdkbox facebook sample project (which has slightly different versions), and this has fixed the issue. Maybe sdkbox is serving the wrong version of a framework somewhere?

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.