manny
manny

Reputation: 63

Facebook and Parse integration unrecognized selector

I'm trying to integrate a Facebook login with my Parse backend. Upon running the app, I receive

[PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:]: unrecognized selector sent to class xxxxxx

on the line

PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(nil)

or

PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)

I have tried the solution here: https://developers.facebook.com/docs/ios/troubleshooting#unrecognizedselector (adding the -ObjC flag), and have cleared Derived Data, to no avail.

I'm using Parse SDK 1.7.2, Facebook SDK 4.0.1, and the PFFacebookUtilesV4 framework.

The full error is as follows:

2015-05-03 14:22:25.742 hotPotato[49116:1453068] +[PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:]: unrecognized selector sent to class 0x10f524048 2015-05-03 14:22:25.810 hotPotato[49116:1453068] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:]: unrecognized selector sent to class 0x10f524048'

Upvotes: 4

Views: 979

Answers (4)

zurakach
zurakach

Reputation: 1394

I faced same issue. My mistake was that I also added ParseFacebookUtils.framework in the project.

Just remove it and everything will be fine :)

Upvotes: 2

Brandon Shega
Brandon Shega

Reputation: 769

Probably a little late but I solved this by using the Bolts.framework from the Facebook SDK as opposed to the Parse SDK.

Upvotes: 0

Bojan Dimovski
Bojan Dimovski

Reputation: 1216

Make sure that you have imported the correct frameworks into your bridging header:

#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <ParseFacebookUtilsV4/PFFacebookUtils.h>

Also check that the needed frameworks are included in the Linked Frameworks and Libraries list under your target's General tab.

If you've added the frameworks manually, go to the Build Settings tab, and make sure that Search Paths contains the paths to the Parse and Facebook frameworks. Mine looks something like this:

$(inherited)
$(PROJECT_DIR)/Vendor/Facebook
$(PROJECT_DIR)/Vendor/Parse

The PFFacebookUtils initialization call in the application(application:, didFinishLaunchingWithOptions:) delegate method should follow the Parse initialization method:

Parse.setApplicationId("<APP_ID>", clientKey:"<CLIENT_KEY>")
PFFacebookUtils.initializeFacebookWithLaunchOptions(launchOptions)

If you haven't done this already, I suggest that you consult Parse's own guide:

https://parse.com/docs/ios_guide#fbusers-setup/iOS

Upvotes: 1

manny
manny

Reputation: 63

My problem was solved by making all my frameworks including my Parse ones referenced instead of copied.

Upvotes: 0

Related Questions