[英]Facebook-unity-sdk not using iOS native SSO
I'm working with Unity 4.6 and Facebook Unity SDK 6.0. 我正在使用Unity 4.6和Facebook Unity SDK 6.0。
On Android things appear swell, but on iOS I don't seem to be utilizing the native Facebook SSO. 在Android上,事情似乎膨胀了,但是在iOS上,我似乎并没有利用原生的Facebook SSO。 It constantly reverts to the browser-based login, which really gives off a unprofessional vibe. 它会不断恢复为基于浏览器的登录,这确实散发出不专业的氛围。
I've tested this on ten different devices, all using both Developer certificates. 我已经在十个不同的设备上进行了测试,都使用了两个Developer证书。
And I've gone through the following checklist: 我已经检查了以下清单:
I've tried with both developer, admin and "stranger" accounts, and not a single one could get the native iOS facebook login. 我已经尝试使用开发者帐户,管理员帐户和“陌生人”帐户,但没有一个帐户可以获取本机iOS Facebook登录。
Have anyone met this ? 有人遇到过这个吗? Most similar cases I could find are over a year old and does not really apply to this. 我发现的大多数类似案例都已经有一年多的历史了,并不真正适用于此。
To get native facebook login on iOS, locate the file FbUnityInterface.mm
(Assets/Facebook/Editor/iOS) and find the method -(void)login:(const char *)scope
. 要在iOS上获取本地Facebook登录,请找到文件FbUnityInterface.mm
(Assets / Facebook / Editor / iOS)并找到-(void)login:(const char *)scope
。
In this method replace: 用这种方法替换:
[self.session openWithBehavior:FBSessionLoginBehaviorWithFallbackToWebView]
with this: 有了这个:
[self.session openWithBehavior:FBSessionLoginBehaviorUseSystemAccountIfPresent]
Facebook Unity SDK by defaults doesn't use native iOS logging behavior, which is kind of strange. 默认情况下,Facebook Unity SDK不使用本机iOS日志记录行为,这有点奇怪。
There are a few more FBSessionLoginType
behaviors, described in FBSession.h
which could be found in the FacebookSDK as well: 还有更多FBSessionLoginType
行为,在FBSession.h
中描述,也可以在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;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.