Search code examples
iosfacebookauthenticationsingle-sign-onsharekit

ios How to just login to facebook using ShareKit2.0 with sso?


What is the best practice to JUST login to facebook, using ShareKit 2.0?

Now I'm using:

service = [[SHKFacebook alloc] init]; [service authorize];

With :

- (void)authorize:(NSArray *)permissions {
self.permissions = permissions;

[self authorizeWithFBAppAuth:YES safariAuth:NO];}

Using this configurations, if fb app is installed, when pressing login it goes to fb app and it is saying that "You have already authorized this app...." Pressing ok returns to my app and logins in without entering credetinals.

Using [self authorizeWithFBAppAuth:NO safariAuth:NO]; prompts the credetianls login dialog.

P.S. I've followed all the steps in Sharekit 2.0 wiki page.

Any idea how to make the app login automatically without going to fb app to press the "Okay" button?

Thanks


Solution

  • In facebook.m

    [self authorizeWithFBAppAuth:NO safariAuth:NO];

    and once logged in you can do the stuff in - (void)fbDidLogin in shkfacebook.m