Facebook-unity-sdk does not use native SSO for iOS

I work with Unity 4.6 and the Facebook Unity SDK 6.0.

Things appear on swell on Android, but on iOS, I don't seem to use my own SSO for Facebook. It constantly returns to the browser based on the input, which really gives an unprofessional atmosphere.

I tested this on ten different devices using both developer certificates.

And I checked the following checklist:

  • Xcode at startup does not receive errors or logs that should indicate something wrong, but still uses the old solution to enter the browser.
  • This also applies when I use the sample script contained in the SDK.
  • The application is enabled for SSO in the console for Facebook developers, and the package identifiers match.
  • The FBXXXXXXXXXX URL is located in the info.plist file and displays in Xcode just fine.
  • Also added the FacebookAppID key in the info.pList file and uses the numerical identifier of the facebook application.
  • On facebook, the application is open to the general public, a contact letter is required, and the iOS package is configured.

I tried with both developers and administrators, as well as with unfamiliar accounts, and none of them could get an account for iOS facebook.

Has anyone met this? Most of these cases that I could find are older than a year and actually do not apply to this.

+8
ios unity3d facebook-unity-sdk
source share
2 answers

On Facebook SDK 7.2, change shareDialogMode in unity itself in MobileFacebook.cs enter image description here

+1
source share

To get your own Facebook login on iOS, find the file FbUnityInterface.mm (Assets / Facebook / Editor / iOS) and find the method -(void)login:(const char *)scope .

In this method, replace:

 [self.session openWithBehavior:FBSessionLoginBehaviorWithFallbackToWebView] 

with this:

 [self.session openWithBehavior:FBSessionLoginBehaviorUseSystemAccountIfPresent] 

The Facebook Unity SDK by default does not use native iOS logging behavior, which is rather strange.

There are a few more FBSessionLoginType methods described in FBSession.h , which can also be found in the FacebookSDK:

 typedef enum { /*! Attempt Facebook Login, ask user for credentials if necessary */ FBSessionLoginBehaviorWithFallbackToWebView = 0, /*! Attempt Facebook Login, no direct request for credentials will be made */ FBSessionLoginBehaviorWithNoFallbackToWebView = 1, /*! Only attempt WebView Login; ask user for credentials */ FBSessionLoginBehaviorForcingWebView = 2, /*! Attempt Facebook Login, prefering system account and falling back to fast app switch if necessary */ FBSessionLoginBehaviorUseSystemAccountIfPresent = 3, /*! Attempt only to login with Safari */ FBSessionLoginBehaviorForcingSafari = 4, } FBSessionLoginBehavior; 
+1
source share

All Articles