简体   繁体   中英

Parse FacebookUtils for iOS 9 failing with -canOpenURL error

I've been using Appcelerator for mobile apps for some time, but due to a problem with the Facebook SDK, I've been looking at swift in order to move the apps to native, and have more control.

All the apps currently use Parse for the back end, and have had Facebook sign in through the Appcelerator Facebook module.

However, all the iOS versions built with Appcelerator now (since iOS9) fail to login with the following error:

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

I have now set up two blank swift projects, one to use the Parse SDK, and one to use the Facebook SDK. Both projects run as intended, saving objects to Parse, and signing in with Facebook respectively.

The Facebook project signs in and retrieves the users email and public_profile fine, and although I still get the above mentioned error it doesn't affect the sign in process, or the data retrieval.

However, I have now tried to amalgamate the two and use the Parse FacebookUtils framework, but I am having the same problem I was having with the Appcelerator apps. I'm getting the error, and then nothing.

This appears to me as though the above error is causing the FacebookUtils framework to fail silently, as with the Appcelerator Facebook module.

So, I guess my initial question is:

Has anyone had any luck using the Parse FacebookUtils framework with iOS9?

If others have been successful, then I can investigate further, I'd just rather not spend hours going round in circles trying to implement something that just isn't possible.

  • Xcode: 7.1.1
  • ParseFacebookUtilsV4
  • Facebook LoginKit: V4.8.0

Here is my swift login code:

let readPermissions = ["public_profile","email","user_friends"]
PFFacebookUtils.logInInBackgroundWithReadPermissions(readPermissions, block: {
            (user: PFUser?, error: NSError?) -> Void in
            NSLog("Signing in")
            if let user = user {
                if user.isNew {
                    NSLog("User signed up through facebook")
                } else {
                    NSLog("User logged in through Facebook")
                }
            } else {
                NSLog("user cancelled login")
            }
        })

The closure is never called, and the logging of "Signing In" is never output.

If it helps I can post the blank project on Github.

Thanks

Paul

I'm not that familiar with the Swift side of things, but my guess is that this is a case of needing to Whitelist the Facebook apps within your info.plist

Read the whitelist section here for information: https://developers.facebook.com/docs/ios/ios9

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM