Facebook SDK 4.5 IOS 9
Asked Answered
S

7

16

I got an issue with the new FBSDK. Whenever I try to call the login method logInWithReadPermissions, I get this error message:

ERROR : "canOpenUrl : failed for url "fbauth2://" error: "(null)"

I have my config .plist file following the ios9 tuto ( https://developers.facebook.com/docs/ios/ios9 ) on dev.facebook. So, I got the NSAppTransportSecurity dictionary and the LSApplicationQueriesSchemes array (with the string "fbauth2" on it)

Would you know how to resolve this error?

Scotney answered 13/8, 2015 at 14:46 Comment(2)
did you ever solve this?Jumble
has this been solved yet?Compromise
B
3

1] Authentication in Developer.facebook and generate Facebook Id like :=>460481580805052

2] Set Bitcode : No From Build Settings

3] Set up Plist File

<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] Download 4 Sdk Framework like

=>Bolts.framework
=>FBSDKCoreKit.framework
=>FBSDKLoginKit.framework
=>FBSDKShareKit.framework
Bobbybobbye answered 3/10, 2015 at 5:59 Comment(0)
M
5

If you still continue to have problems, reset the simulator, this worked for me.

Monotype answered 21/9, 2015 at 15:53 Comment(2)
I'm having this problem on a real device, plists updatedLipps
Went around in circles until resetting the simulator. Thanks!Acetal
S
4

I have the same problem with Google+ Sign-in library, but i solved for Facebook updating at the last SDK version 4.6.0!

Remember to change your plist key LSApplicationQueriesSchemes after the update like this:

<key>LSApplicationQueriesSchemes</key>
<array>
        <string>fbapi</string>
        <string>fb-messenger-api</string>
        <string>fbauth2</string>
        <string>fbshareextension</string>
</array>
Spartacus answered 24/8, 2015 at 3:27 Comment(1)
Just a note, according to the FAQ: Why do I see console messages like 'canOpenURL: failed for URL: "fb...://' or ? 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 warningCrabstick
B
3

1] Authentication in Developer.facebook and generate Facebook Id like :=>460481580805052

2] Set Bitcode : No From Build Settings

3] Set up Plist File

<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] Download 4 Sdk Framework like

=>Bolts.framework
=>FBSDKCoreKit.framework
=>FBSDKLoginKit.framework
=>FBSDKShareKit.framework
Bobbybobbye answered 3/10, 2015 at 5:59 Comment(0)
P
0

I had the same problem, but ran the app on my phone which has facebook installed and it worked. It might be because it doesn't work on the simulator or facebook has to be installed. Anyone found anything else?

Perseid answered 25/8, 2015 at 11:51 Comment(1)
Simulator works for me. I only need to add fbauth2. It will redirect to Facebook website.Orren
O
0

if you already have items on LSApplicationQueriesSchemes. let the Facebook items first.

This solved my problem.

Obsequent answered 16/10, 2015 at 15:25 Comment(4)
Can you please elaborate on that? Please?Bates
This is the wrong way <key>LSApplicationQueriesSchemes</key> <array> <string>com.sample.appid</string> <string>fbapi</string> <string>fb-messenger-api</string> <string>fbauth2</string> <string>fbshareextension</string> </array>Obsequent
Thank you for reaching out to me. Please explain one thing here though; com.sample.appid is bundle indentifier or for example my app is xyz on facebook and my appid is 1234567890 so this is com.xyz.1234567890 ? Which one of the two.. thank you for the clarification though.Bates
Is an example of a bundle id. Just let your Facebook keys at the beginning of the array , and this will solve your problemObsequent
M
0

From Facebook FAQ at the bottom of the link: https://developers.facebook.com/docs/ios/ios9

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

Magisterial answered 17/6, 2016 at 22:44 Comment(0)
R
-2

Use like this in info.plist

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

After that you should remove your app from editor and launch again.

Raddled answered 5/11, 2015 at 13:36 Comment(1)
That's wrong. That would indicate your app responds to an URL with fbauth2: scheme. That scheme is Facebook's responsibility.Cordeliacordelie

© 2022 - 2024 — McMap. All rights reserved.