jyce1492 jyce1492 - 1 year ago 82
iOS Question

FBLoginView crashes when user has an account in Settings>Facebook

Im using facebookSDK FbLoginView, after I select ok on allowing access of basic profile info and friends list. It crashes then passes on this part

else if (errorCategory == FBErrorCategoryUserCancelled) {
// The user has cancelled a login. You can inspect the error
// for more context. For this sample, we will simply ignore it.
NSLog(@"%@",[error localizedDescription]);
NSLog(@"user cancelled login");

I receive this log.

2013-11-30 13:42:54.000 OreoTime[1628:70b] The operation couldn’t be
completed. (com.facebook.sdk error 2.) 2013-11-30 13:42:54.000
OreoTime[1628:70b] user cancelled login

This only happens when the user has an acccount logged in in Settings>Facebook, but when not it works fine.

How to solve this issue?

Answer Source

I have also faced this issue. I solved this after editting the Facebook App setting in Facebook Developer portal.

enable the Native iOS App option and Add app bundle identifier there.

I am attaching a screenShot for more details.

Screenshot enter image description here

If You want to remove the Native iOS App then you have to Read the Facebook Login Flow

According to Facebook:

The Facebook SDK automatically selects the optimal login dialog flow based on the account settings and capabilities of a person's device. This is the default sequence that the Facebook SDK implements:

iOS Login Dialog

Facebook App Native Login Dialog

Facebook App Web Login Dialog

Mobile Safari Login Dialog

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download