Use of unresolved identifier PFFacebookUtils

依然范特西╮ 提交于 2019-12-01 16:27:05

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

You may need to

import ParseFacebookUtils

in your AppDelegate

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.

Resolved! #import in bridging header

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!