简体   繁体   English

在XCode 7.0.1中将FB SDK(版本4.7.0)与iOS 9集成时出错:canOpenURL:URL失败:“ fbauth2:/”

[英]Error with integrating FB SDK (Version 4.7.0) with iOS 9 in XCode 7.0.1: canOpenURL: failed for URL: “fbauth2:/”

I follow the latest instruction at here for integrating FBSDK (Version 4.7.0 downloaded) with my latest XCode. 我按照此处的最新说明将FBSDK(下载的版本4.7.0)与最新的XCode集成在一起。 I am pretty sure I have configured the following in info.plist (I only need these for Version 4.7.0 ): 我很确定我已经在info.plist中配置了以下内容(我仅在4.7.0版中需要这些内容):

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

and copied everything as Facebook provided in my Facebook Development account. 并复制了我在Facebook开发帐户中提供的所有内容。 However, when I tried to login with the Facebook Login Button, I got this error: 但是,当我尝试使用Facebook登录按钮登录时,出现此错误:

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

When I see this error, my app just stuck and does not seem to have been authenticated even if I have clicked 'OK' in Safari. 当我看到此错误时,我的应用只是卡住了,即使我在Safari中单击了“确定”也似乎未通过身份验证。 I also saw the following as explained by Facebook, but it doesn't make sense to me, as my app remains stuck with this error message. 我还看到了Facebook所解释的以下内容,但对我来说这没有意义,因为我的应用程序始终停留在此错误消息中。

In iOS 9, the app switches can prompt the user with a confirmation dialog. The SDK will try to minimize the frequency of this by choosing the best dialog available (such as SafariViewController), but this is by design in iOS 9.

I know this may sound silly, but I found the solution, which is not related to the settings in my .plist file. 我知道这听起来很愚蠢,但是我找到了解决方案,该解决方案与.plist文件中的设置无关。 I put the two following functions in my App Delegate, everything works correctly despite of the above warning for fbauth2 我将以下两个函数放入我的App Delegate中,尽管上面出现了fbauth2警告,但一切正常

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool {
        // return FBAppCall.handleOpenURL(url, sourceApplication:sourceApplication, session:PFFacebookUtils.session())
        return FBSDKApplicationDelegate.sharedInstance().application(application,
            openURL: url,
            sourceApplication: sourceApplication,
        annotation: annotation)

    }



    //Make sure it isn't already declared in the app delegate (possible redefinition of func error)
    func applicationDidBecomeActive(application: UIApplication) {
        FBSDKAppEvents.activateApp()
    }

暂无
暂无

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

相关问题 -canOpenURL:URL失败:“ fbauth2:/”-iOS 9错误:“(空)”(快速) - -canOpenURL: failed for URL: “fbauth2:/” - error: “(null)” for ios 9 (swift) -canOpenURL:URL失败:“fbauth2:/” - 错误:“(null)” - -canOpenURL: failed for URL: “fbauth2:/” - error: “(null)” -canOpenURL:URL失败:“fbauth2:/” - 错误:“此应用程序不允许查询方案fbauth2”(OSStatus错误-10814。) - -canOpenURL: failed for URL: “fbauth2:/” - error: “This app is not allowed to query for scheme fbauth2” (OSStatus error -10814.) -canOpenURL:URL失败:“fbauth2:/”(OSStatus错误-10814。)“ - -canOpenURL: failed for URL: “fbauth2:/” (OSStatus error -10814.)" Facebook 登录套件,带有 iOS 13“canOpenURL:URL 失败:“fbauth2:///” - Facebook Login kit with iOS 13 "canOpenURL: failed for URL: “fbauth2:///”" facebook登录问题 - canOpenURL:网址失败:“fbauth2:///” - 错误:“(null)” - facebook login issue - canOpenURL: failed for URL: “fbauth2:///” - error: “(null)” iOS 9 Facebook登录模拟器-canOpenURL:URL失败:“ fbauth2:///”-错误:“(空)” - iOS 9 Facebook login simulator -canOpenURL: failed for URL: “fbauth2:///” - error: “(null)” iOS:-canOpenURL:URL失败:“ fbauth2:/”-错误:“操作无法完成。 (OSStatus错误-10814。)”在模拟器和设备上 - iOS: -canOpenURL: failed for URL: “fbauth2:/” - error: “The operation couldn’t be completed. (OSStatus error -10814.)” on Simulators & Devices Facebook登录无法加载并显示错误-canOpenURL:URL失败:“ fbauth2:/”-错误: - Facebook Login doesn't load and prints error -canOpenURL: failed for URL: “fbauth2:/” - error: -canOpenURL:URL 失败:“fbauth2:/” - 错误:“操作无法完成。(OSStatus 错误 -10814。) - -canOpenURL: failed for URL: "fbauth2:/" - error: "The operation couldn’t be completed. (OSStatus error -10814.)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM