11

I got the following error message when I was trying to integrate latest Facebook sdk 4.5 to my swift project:

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

I have no problem to login with Facebook and got user name and email but I saw this error in my Xcode console.

My info.plist:

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>fbapi</string>
    <string>fbauth2</string>
    <string>fbshareextension</string>
</array>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

What could be the reason cause the problem? Thanks.

Updated:

Based on Facebook document:

If you're recompiling with iOS SDK 9.0, add the following to your application's plist if you're using a version of the SDK v4.5 or older:

I changed my info.plist:

<key>LSApplicationQueriesSchemes</key>
    <array>
        <string>fbapi</string>
        <string>fbapi20130214</string>
        <string>fbapi20130410</string>
        <string>fbapi20140410</string>
        <string>fbapi20140116</string>
        <string>fbapi20150313</string>
        <string>fbapi20150629</string>
        <string>fbauth</string>
        <string>fbauth2</string>
        <string>fb-messenger-api20140430</string>
    </array>

Unfortunately I still got the same problem although my FBlogin, FBShare works well.

Bagusflyer
  • 12,675
  • 21
  • 96
  • 179

1 Answers1

1

According to the Facebook Docs:

This is an Xcode warning indicating the the canOpenURL: call returned false. As long as you have configured the LSApplicationQueriesSchemes entry in your plist as described above, you can ignore this warning

https://developers.facebook.com/docs/ios/ios9

SteffenK
  • 582
  • 6
  • 17
  • 2
    I've seen that same answer copy/pasted a few times on this question. Does it in fact work although it's posting that error? I have the same console message (although mine says the url is "fbauth2:/".. only one slash) and it does not in fact log in or produce an error. The block of the login function doesn't actually run. Frustrating because the provided login button works, but i can't get a custom button to run the login function – Chris Slowik Nov 25 '15 at 23:21