1

I am integrating login with Facebook functionality in my app. Before iOS 9 it works like charm.

Before: If device has native facebook app installed and login, then login with Facebook button opens native app otherwise opens safari browser.

Now: If device has native facebook app installed and login, then login with Facebook button opens SFSafariViewController in app.

I have updated facebook sdk to 4.7 (latest),

Update: How should i disable SFSafariViewController from opening and open native app for login (if native app is available.) please help me what to do now. Thanks in Advanced

Suraj Sonawane
  • 2,044
  • 1
  • 14
  • 24

1 Answers1

1

In your Info.plist under the LSApplicationQueriesSchemes key (an array of strings):

enter image description here

Then... In you login button add the next line:

  FBSDKLoginButton * facebookLoginButton =[[FBSDKLoginButton alloc] init];
  facebookLoginButton.loginBehavior=FBSDKLoginBehaviorNative;

If you use custom button you also can add it to the FBSDKLoginManager class like that:

  FBSDKLoginManager * fbManager =  [FBSDKLoginManager new];
  fbManager.loginBehavior=FBSDKLoginBehaviorNative;
daniel kilinskas
  • 3,538
  • 3
  • 16
  • 10