Facebook SDK 4.5 IOS 9

我遇到了新的FBSDK问题。 每当我尝试调用login方法logInWithReadPermissions,我收到此错误消息:

错误:“canOpenUrl:URL失败”fbauth2://“error:”(null)“

我有我的configuration.plist文件在dev.facebook上的ios9 tuto( https://developers.facebook.com/docs/ios/ios9 )之后。 所以,我得到了NSAppTransportSecurity字典和LSApplicationQueriesSchemes数组(string“fbauth2”就可以了)

你会知道如何解决这个错误?

1]在Developer.facebook中进行身份validation并生成Facebook ID,例如:=> 460481580805052

2]设置位码:否来自生成设置

3]设置Plist文件

<key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleTypeRole</key> <string>Editor</string> <key>CFBundleURLSchemes</key> <array> <string>fb460481580805052</string> </array> </dict> </array> <key>FacebookAppID</key> <string>460481580805052</string> <key>LSRequiresIPhoneOS</key> <true/> <key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>akamaihd.net</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> </dict> <key>facebook.com</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> </dict> <key>fbcdn.net</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> </dict> </dict> </dict> <key>LSApplicationQueriesSchemes</key> <array> <string>fbapi</string> <string>fbapi20130214</string> <string>fbapi20130410</string> <string>fbapi20130702</string> <string>fbapi20131010</string> <string>fbapi20131219</string> <string>fbapi20140410</string> <string>fbapi20140116</string> <string>fbapi20150313</string> <string>fbapi20150629</string> <string>fbauth</string> <string>fbauth2 </string> <string>fb-messenger-api20140430</string> <string>fb-messenger-platform-20150128</string> <string>fb-messenger-platform-20150218</string> <string>fb-messenger-platform-20150305</string> </array> 

4]下载4个Sdk框架

 =>Bolts.framework =>FBSDKCoreKit.framework =>FBSDKLoginKit.framework =>FBSDKShareKit.framework 

如果你仍然有问题,重置模拟器,这为我工作。

我在Google+login库中遇到同样的问题,但是我在最后一个SDK版本4.6.0上解决了Facebook更新问题!

请记住在更新后更改您的plist键LSApplicationQueriesSchemes ,如下所示:

 <key>LSApplicationQueriesSchemes</key> <array> <string>fbapi</string> <string>fb-messenger-api</string> <string>fbauth2</string> <string>fbshareextension</string> </array> 

我有同样的问题,但跑了我的手机上安装了Facebook的应用程序,它的工作。 这可能是因为它不能在模拟器上工作或Facebook必须安装。 任何人都发现了别的?

如果您已经有LSApplicationQueriesSchemes项目。 首先让Facebook项目。

这解决了我的问题。

从Facebook的常见问题链接的底部: https : //developers.facebook.com/docs/ios/ios9

这是一个Xcode警告,指示canOpenURL:调用返回false。 只要你像上面描述的那样在plist中configuration了LSApplicationQueriesSchemes条目,你可以忽略这个警告

在info.plist中使用

 <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLSchemes</key> <array> <string>fb123124123123</string> <string>fbauth2</string> </array> </dict> </array> 

之后,你应该从编辑器中删除你的应用程序,并再次启动。