我设置了与 FB 开发者页面相同的所有内容(appId、appName、bundleId...)。我在 FBSDK 4.6 和 iOS 9 上工作。我也已经在 info.plist 上添加了这个 key 。
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
但是,在运行时,我收到了这样的输出错误:
canOpenURL: failed for URL: "fbauth2:///" - error: "(null)"
有人知道发生了什么吗?
最佳答案
对于 iOS 9,您已经向 info.plist 添加了更多键。
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>facebook.com</key>
<dict>
<key>NSIncludesSubdomains</key> <true/>
<key>NSExceptionRequiresForwardSecrecy</key> <false/>
</dict>
<key>fbcdn.net</key>
<dict>
<key>NSIncludesSubdomains</key> <true/>
<key>NSExceptionRequiresForwardSecrecy</key> <false/>
</dict>
<key>akamaihd.net</key>
<dict>
<key>NSIncludesSubdomains</key> <true/>
<key>NSExceptionRequiresForwardSecrecy</key> <false/>
</dict>
</dict>
</dict>
关于ios - Facebook 登录 iOS FBSDK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32656740/