objective c - How to setup Facebook iOS SDK properly with Parse in AppDelegate? -
i'm trying integrate facebook parse project, have problems new sdk version.
with older versions i've imported related header files appdelegate, pasted 2 methods , worked well.
this how i've done it:
// appdelegate.m #import <parse/parse.h> #import <parsefacebookutils/pffacebookutils.h> #import <facebooksdk/facebooksdk.h> - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { [parse setapplicationid:@"xy" clientkey:@"xy"]; [pffacebookutils initializefacebook]; [pfanalytics trackappopenedwithlaunchoptions:launchoptions]; return yes; } - (bool)application:(uiapplication *)application openurl:(nsurl *)url sourceapplication:(nsstring *)sourceapplication annotation:(id)annotation { return [fbappcall handleopenurl:url sourceapplication:sourceapplication withsession:[pffacebookutils session]]; } - (void)applicationdidbecomeactive:(uiapplication *)application { [fbappcall handledidbecomeactivewithsession:[pffacebookutils session]]; }
but facebook sdk contains several frameworks , it's not clear 1 needed or not. i'm trying below code, getting error: use of undeclared identifier 'pffacebookutils'
.
// appdelegate.m #import <parse/parse.h> #import <fbsdkcorekit/fbsdkcorekit.h> - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { [parse setapplicationid:@"xy" clientkey:@"xy"]; [pffacebookutils initializefacebook]; [pfanalytics trackappopenedwithlaunchoptions:launchoptions]; return yes; } - (bool)application:(uiapplication *)application openurl:(nsurl *)url sourceapplication:(nsstring *)sourceapplication annotation:(id)annotation { return [[fbsdkapplicationdelegate sharedinstance] application:application openurl:url sourceapplication:sourceapplication annotation:annotation]; } - (void)applicationdidbecomeactive:(uiapplication *)application { [fbsdkappevents activateapp]; }
i appreciate if show me own fb sdk setup in appdelegate parse or explain me did wrong.
here share how i've integrated fb project parse.
appdelegate.m
#import <parsefacebookutils/pffacebookutils.h> - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { ... [pffacebookutils initializefacebook]; // don't forget this. it's not mentioned in tutorial ... } - (bool)application:(uiapplication *)application openurl:(nsurl *)url sourceapplication:(nsstring *)sourceapplication annotation:(id)annotation { return [fbappcall handleopenurl:url sourceapplication:sourceapplication withsession:[pffacebookutils session]]; } - (void)applicationwillterminate:(uiapplication *)application { [[pffacebookutils session] close]; }
hope helps.
Comments
Post a Comment