Thursday, 19 September 2013

Unable to perform facebook iOS Native Login in custom Project

Unable to perform facebook iOS Native Login in custom Project

I need to perform a Facebook Native Login from my iOS App but it is not
working. Instead of showing me the in-app confirmation dialog (the
expected behavior) my App always switches to Safari to authenticate the
user.
The annoying thing is that i tried the all relevant samples
(SessionLoginSample, HelloFacebookSample, Scrumptious) and they are all
working as expected. The example Projects also work with my own Facebook
App but when i create a project by myself it does not work.
To make it even worse: When i copy the code from e.g. SessionLoginSample
(modified to Native Login and working as sample project) to my own project
it stops working and the app is switching to the browser again. If i copy
my code into one the sample projects it is working quite well again.
How i login with SessionLoginExample:
[appDelegate.session
openWithBehavior:FBSessionLoginBehaviorUseSystemAccountIfPresent
completionHandler:^(FBSession *session,
FBSessionState status,
NSError *error) {
// and here we make sure to update our UX according to the new
session state
[self updateView];
}];
What i tried to enable Native Login:
created a Facebook App with all necessary information according to
https://developers.facebook.com/docs/ios/getting-started/
on my iPhone i entered login credentials: Settings->Facebook (no test user)
i followed the steps described in
https://developers.facebook.com/docs/ios/ios-sdk-tutorial/authenticate/
i triple checked the configurations in Info.plist and even the entries in
the Xcode Build Settings Pane and they are all the same
Please help me, at least with a hint or something. Thanks in advance.

No comments:

Post a Comment