parse.com - How to stop open Safari when Login Facebook via Parse SDK -


i using parse set facebook login, jump safari when click pfloginfieldsfacebook button. want have in app login page(uiwebview or something). want because noticed ios 9 give safari when app. here code using:

pfloginviewcontroller *loginviewcontroller = [[pfloginviewcontroller alloc] init]; [loginviewcontroller setdelegate:self]; // set ourselves delegate                 // create sign view controller                 loginviewcontroller.fields = pfloginfieldsfacebook;                 // present log in view controller                 [self presentviewcontroller:loginviewcontroller animated:yes completion:null]; loginviewcontroller.loginview.layer.contents = (id)[uiimage imagenamed:@"allow.png"].cgimage; [loginviewcontroller.loginview setlogo:nil]; 

i find latest facebook sdk can job, still getting used using parse. please me out.

after reading through parse doc, figured out appdelegate.m file should updated ios 9:

there's 2 code changes you'll need make. first, add following application:didfinishlaunchingwithoptions: method, after you've initialized parse sdk.

// appdelegate.m #import <fbsdkcorekit/fbsdkcorekit.h> #import <parsefacebookutilsv4/pffacebookutils.h>  @implementation appdelegate  - (void)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions {   [parse setapplicationid:@"parseappid" clientkey:@"parseclientkey"];   [pffacebookutils initializefacebookwithapplicationlaunchoptions:launchoptions]; }   next, add following handlers in app delegate.  - (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]; } 

there 2 main ways use facebook parse users: (1) log in (or sign up) facebook user , creating pfuser, or (2) linking facebook existing pfuser.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -