stack-o-frankie
stack-o-frankie

Reputation: 457

Facebook sdk iPhone authentication

I followed the Facebook tutorial for developing a native iPhone app and couldn't make it work at first. It seems that the reason was the fact that I had the official Facebook app also installed on the phone.

As soon as I uninstalled the official app, the application started working. The same happened while trying the Hackbook demo app from Facebook.

Before uninstalling the official app, both my app and the Hackbook were launching the Facebook app upon authentication without prompting for username and password or doing anything else. The Facebook official app simply stayed up like it was launched independently from the rest. After uninstalling it, the two apps were opening a Safari instance with the appropriate authentication screen.

Is there some incompatibility between the Graph API and the official iPhone Facebook app?

Upvotes: 1

Views: 459

Answers (1)

aahsanali
aahsanali

Reputation: 3547

read this (step5 specially)

Facebook.m find

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

  [self authorizeWithFBAppAuth:YES safariAuth:YES];
}

and set both parameters to NO

[self authorizeWithFBAppAuth:NO safariAuth:NO];

if both parameters are set to NO, Application will show in app popup for Facebook authentication.

What this does is, this performs the authentication using Facebook application if installed or Safari if facebook application isn't install. If you want to authenticate using safari then just set first parameter to NO

[self authorizeWithFBAppAuth:NO safariAuth:YES];

This will open safari for Facebook authentication.

Upvotes: 2

Related Questions