Facebook Login Failure iOS9 + Parse

Trying to login using Facebook + Parse using the following code:

I noticed that when I click the "Login with Facebook" button, this appears twice in the console.

-canOpenURL: failed URL: "fbauth2: //" - error: "This application is not allowed to request for the fbauth2 scheme"

Here is my code:

- (IBAction)loginWithFacebook:(id)sender { // Set permissions required from the facebook user account NSArray *permissionsArray = @[ @"user_about_me", @"user_relationships", @"user_birthday", @"user_location"]; // Login PFUser using Facebook [PFFacebookUtils logInWithPermissions: permissionsArray block:^(PFUser * _Nullable user, NSError * _Nullable error) { if (!user) { NSLog(@"Uh oh. The user cancelled the Facebook login."); } else if (user.isNew) { NSLog(@"User signed up and logged in through Facebook!"); } else { NSLog(@"User logged in through Facebook!"); } }]; } 

I added this to my plist, as in other topics, but still getting the same error. [[CHANGE ANSWER BELOW ARTIFICIAL NUMBER]]

 <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLSchemes</key> <array> <string>fb991863067537019</string> </array> </dict> </array> <key>FacebookAppID</key> <string>991863067537019</string> <key>FacebookDisplayName</key> <string>Ziplyne</string> <key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>facebook.com</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSExceptionRequiresForwardSecrecy</key> <false/> </dict> <key>fbcdn.net</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSExceptionRequiresForwardSecrecy</key> <false/> </dict> <key>akamaihd.net</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSExceptionRequiresForwardSecrecy</key> <false/> </dict> </dict> </dict> <key>LSApplicationQueriesSchemes</key> <array> <string>fbapi</string> <string>fb-messenger-api</string> <string>fbauth2</string> <string>fbshareextension</string> </array> 
+5
source share
1 answer

If you recompile with iOS SDK 9.0, add the following to your application level if you are using SDK v4.5 or later:

 <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> </array> 

If you are using FBSDKMessengerShareKit from versions older than v4.6, add

 <string>fb-messenger-platform-20150128</string> <string>fb-messenger-platform-20150218</string> <string>fb-messenger-platform-20150305</string> 

If you are using the v4.6.0 SDK, you only need to add:

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

Doc: https://developers.facebook.com/docs/ios/ios9

+2
source

Source: https://habr.com/ru/post/1241153/


All Articles