ios - Unable to Compile Parse + Facebook SDK (Apple Mach-O Linker Error) -
i trying use add facebook sdk ios parse project. trying to
i followed setup instruction here:
in bridging header added:
#import <fbsdkcorekit/fbsdkcorekit.h> #import <fbsdkloginkit/fbsdkloginkit.h> #import <parsefacebookutilsv4/pffacebookutils.h>
up point compiles fine, when try add logintofacebook code, apple mach-o linker error
var permissionarray = ["user_about_me","user_relationships","user_relationships","user_location"]; pffacebookutils.logininbackgroundwithreadpermissions(permissionarray) { (user: pfuser?, error: nserror?) -> void in if (user == nil) { println("canceled facebook login."); } else if (user!.isnew) { println("user signed , logged in through facebook!"); } else { println("login through facebook"); } }
any idea have done wrong?
i have done parse+fb , here did :
my bridge header :
#import <fbsdkcorekit/fbsdkcorekit.h> #import <fbsdkloginkit/fbsdkloginkit.h> #import <parse/parse.h> #import <parse/pfobject+subclass.h> #import <parseui/parseui.h> #import <parsefacebookutilsv4/pffacebookutils.h> #import <bolts/bolts.h>
my build phases screenshot
in appdelegate.swift :
func application(application: uiapplication, openurl url: nsurl, sourceapplication: string?, annotation: anyobject?) -> bool { return fbsdkapplicationdelegate.sharedinstance().application(application, openurl: url, sourceapplication: sourceapplication, annotation: annotation) } func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool { // override point customization after application launch. parse.enablelocaldatastore() // initialize parse. parse.setapplicationid("", clientkey: "") return true }
in loginviewcontroller have iboulet login button
var permissions = [ "public_profile", "email", "user_friends" ] @ibaction func facebooklogin(sender: anyobject) { pffacebookutils.logininbackgroundwithreadpermissions(permissions, block: { (user: pfuser?, error: nserror?) -> void in if let user = user { if user.isnew { println("user signed , logged in through facebook!") } else { println("user logged in through facebook!") } } else { println("uh oh. user cancelled facebook login.") } }) }
let me know if still have issues
Comments
Post a Comment