简体   繁体   English

iOS FBSDK上的Facebook登录

[英]Facebook login on iOS FBSDK

I setup everything same as FB developer page (appId, appName, bundleId...). 我将所有设置都与FB开发人员页面相同(appId,appName,bundleId ...)。 I work on FBSDK 4.6 and iOS 9. I also already added this key on info.plist. 我在FBSDK 4.6和iOS 9上工作。我也已经在info.plist上添加了此密钥。

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

However, when running, I received the output error like this: 但是,在运行时,我收到如下输出错误:

canOpenURL: failed for URL: "fbauth2:///" - error: "(null)"

Anyone know what happened? 有人知道发生了什么吗?

For iOS 9 you have add more keys to the info.plist. 对于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>

Facebook getting started Facebook入门

Run the app on your phone to test with Facebook installed. 在手机上运行该应用程序以测试是否安装了Facebook。 It might be because it doesn't work on the simulator or facebook has to be installed. 可能是因为它在模拟器上不起作用或必须安装facebook。

i would ignore it. 我会忽略它。

per their FAQs, facebook acknowledges this and recommends you let it go so as long as you've properly set up their plist settings 根据他们的常见问题解答,facebook会承认这一点,并建议您放手,只要您正确设置了他们的plist设置

Why do I see console messages like 'canOpenURL: failed for URL: "fb...://' or ? 为什么我看到控制台消息,例如“ canOpenURL:URL失败:“ fb ...://”或?

This is an Xcode warning indicating the the canOpenURL: call returned false. 这是Xcode警告,指示canOpenURL:调用返回false。 As long as you have configured the LSApplicationQueriesSchemes entry in your plist as described above, you can ignore this warning 只要您如上所述在plist中配置了LSApplicationQueriesSchemes条目,就可以忽略此警告

source: https://developers.facebook.com/docs/ios/ios9 来源: https : //developers.facebook.com/docs/ios/ios9

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

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