11
votes

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.

1

1 Answers

1
votes

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