No known class method for selector 'logInInBackgroundWithReadPermissions:block:'

1.6k views Asked by At

Im using PFFacebookUtils to set up user login with parse and facebook. I am using the code exactly from this link: https://github.com/ParsePlatform/ParseUI-iOS/wiki/Integrate-Login-with-Facebook

Heres a look at my code:

 NSArray *permissionsArray = @[ @"user_about_me", @"user_relationships", @"user_birthday", @"user_location"];

// Login PFUser using Facebook
[PFFacebookUtils logInInBackgroundWithReadPermissions:permissionsArray block:^(PFUser *user, NSError *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!");
    }
}];

Xcode is telling me that this method does not exist. Even though I know the method is and I have all of the right header files imported

#import "SWLoginViewController.h"
#import "PFFacebookUtils.h"
#import <Parse/Parse.h>
#import "SWUser.h"
#import "SWFacebookDataRetriever.h"
#import "SWHomeViewController.h"
#import "SWProfileViewController.h"
#import "Colours.h"
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import <ParseUI/ParseUI.h>
1

There are 1 answers

1
Mason Lee On

If you are using the old pod 'ParseFacebookUtils', instead update your podfile to use pod 'ParseFacebookUtilsV4' and then #import <ParseFacebookUtilsV4/PFFacebookUtils.h>