简体   繁体   English

Facebook iOS SDK本机登录无法正常工作

[英]Facebook iOS SDK native login not working

I've implemented facebook sdk into my project and everything is setup exactly as shown in guide https://developers.facebook.com/docs/facebook-login/ios/v2.0 , including info.plist file. 我已经将facebook sdk实现到我的项目中,所有内容都完全按照https://developers.facebook.com/docs/facebook-login/ios/v2.0指南中的设置进行设置,包括info.plist文件。

FacebookAppID, FacebookDisplayName and URL types are set (see image) 设置了FacebookAppID,FacebookDisplayName和URL类型(见图)

Info.plist设置

Everything is working when I use facebook app login, or browser login, but when I've added account into devide, so iOS native login dialog should be present, nothing happend, log only displays User cancelled every time I press Facebook login button. 当我使用Facebook app登录或浏览器登录时,一切正常,但是当我将帐户添加到devide时,因此iOS本机登录对话框应该存在,没有任何事情发生,日志只显示User cancelled每次按Facebook登录按钮时User cancelled

I've done several projects before with facebook login implementation and I've not experienced this error. 我在Facebook登录实施之前已经完成了几个项目,但我没有遇到过这个错误。 I think I'm missing something but somehow I can't figure. 我想我错过了什么,但不知怎的,我无法想象。 The appId and item 0 with prefix have the same numbers and display name is copied exactly from FB developer. 带有前缀的appId和item 0具有相同的编号,显示名称完全从FB开发人员复制。

The strange issue I've noticed here is that when I first install app on device with FB account setup in settings, I can click it once...nothing happend and after second click the application is automatically disabled in Settings > Facebook. 我在这里注意到的一个奇怪的问题是,当我第一次在设备上安装FB帐户的设备上安装应用程序时,我可以点击一次......没有任何事情发生,在第二次点击后,应用程序在设置> Facebook中自动禁用。

UPDATE : I was able to login with native login dialog with older version of Facebook SDK (I've just replaced latest SDK with older one and now it works...don't forget to change permissions because latest SDK uses permissions public_profile instead of basic_profile used in older versions of SDK) why native login is not working with latest FB SDK is still a mistery :) 更新 :我能够使用旧版本的Facebook SDK登录本机登录对话框(我刚刚用旧版本更换了最新的SDK,现在它可以正常运行...不要忘记更改权限,因为最新的SDK使用权限public_profile而不是在旧版SDK中使用的basic_profile )为什么本机登录不能使用最新的FB SDK仍然是一个谜:)

The answer to 答案

'why native login is not working with latest FB SDK is still a mystery'? '为什么原生登录不能使用最新的FB SDK仍然是个谜?

is here . 这里 See the upgrade guide form 3.13 > 3.14. 请参阅升级指南表3.13> 3.14。 The default login behavior has changed from FBSessionLoginBehaviorUseSystemAccountIfPresent to FBSessionLoginBehaviorWithFallbackToWebView 默认登录行为已从FBSessionLoginBehaviorUseSystemAccountIfPresent更改为FBSessionLoginBehaviorWithFallbackToWebView

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM