Use of unresolved identifier PFFacebookUtils

3.8k views Asked by At

I've done all is mentioned here (https://www.parse.com/docs/ios_guide#fbusers/iOS) for implement in iOS the Facebook Login.

The problem is that i have an compile error "Use of unresolved identifier PFFacebookUtils" near che line

PFFacebookUtils.initializeFacebook()

in AppDelegate. I've correctly imported the Parse and Facebook Framework into my project. Are there some bug knowed in Xcode 6 Beta?

5

There are 5 answers

0
Nikolai Ischuk On

If you want to use PFFacebookUtils or/and PFLogInViewController with swift, you have to do this:

  1. For not V4 version: #import <ParseFacebookUtils/PFFacebookUtils.h>in bridging header and then import ParseFacebookUtils in swift file. And call PFFacebookUtils.initializeFacebook() somewhere, of course best place for this is application didFinishLaunchingWithOptions.
  2. For V4 version: #import <ParseFacebookUtilsV4/PFFacebookUtils.h> in bridging header and import ParseFacebookUtilsV4 in swift file. And call PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions) in application didFinishLaunchingWithOptions.

Of course you should have set your bridging header correctly and import frameworks.

0
Zack Shapiro On

After the update to Parse/FacebookUtils, to import you do #import <Parse/PFFacebookUtils.h>

0
abinop On

You may need to

import ParseFacebookUtils

in your AppDelegate

0
Kobazzo On

Resolved! #import in bridging header

0
Malloc On

Parse docs doesn't mention this yet: After downloading the Parse iOS SDK, You should include the ParseFacebookUtils.framework into your project, then import it in each file you want to use it, like you did for the Parse.framework itself:

#import <Parse/Parse.h>// This use to be enough to use Facebook utilities
#import <ParseFacebookUtils/PFFacebookUtils.h>// But now we should import this framework as well to use Facebook utilitis

Parse team has separated the Facebook related classes from Parse API, hence a ParseFacebookUtils.framework