Facebook SDK 4.5 IOS 9 [英] Facebook SDK 4.5 IOS 9

查看:111
本文介绍了Facebook SDK 4.5 IOS 9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有新的FBSDK问题。每当我尝试调用登录方法logInWithReadPermissions,我得到这个错误消息:


错误:canOpenUrl:url失败fbauth2:/ /error:(null)


我的配置.plist文件跟随ios9 tuto( https://developers.facebook.com/docs/ios/ios9 )在dev.facebook上,所以我得到了NSAppTransportSecurity字典和LSApplicationQueriesSchemes数组(带有字符串fbauth2)



你会知道如何解决这个错误?

解决方案

1]在Developer.facebook中进行身份验证并生成Facebook Id,如:=> 460481580805052



2]设置Bitcode:No From Build Settings



3]设置Plist文件

 < key> CFBundleURLTypes< / key> 
< array>
< dict>
< key> CFBundleTy peRole< /密钥GT;
< string>编辑器< / 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]下载4 Sdk框架像

  => Bolts.framework 
=> FBSDKCoreKit.framework
=> FBSDKLoginKit.framework
=> FBSDKShareKit.framework


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?

解决方案

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

这篇关于Facebook SDK 4.5 IOS 9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆