7

I have just updated my PhoneGap iOS app to the latest version 2.1. Since it uses Facebook login I also updated the Facebook Connect Plugin as showed here.

The Facebook login runs smoothly on the emulator (using both iOS 5.1 and 6.0) but I got an error on the device (using iOS 6) "The operation couldn't be completed com.facebook.sdk Error 2"

It seems to be a problem with the BundleID of my app not matching the one on the Facebook app. I checked that BundleIdentifier and BundleURLName in my info.plist file match the Bundle ID under Native iOS app in the settings of my Facebook app.

If someone could help me understand what's wrong... Thanks a lot.

dfucci
  • 685
  • 1
  • 10
  • 17

3 Answers3

5

This error could also happen if the app has been turned off on the Facebook iOS6 settings. Go to the device Settings app, check Facebook and see if your app is turned off, by checking the "Allow These Apps to Use Your Account:" section.

For a related discussion, if you find this to be the issue, see SDK 3.1: How to tell whether SDK is using iOS6 accounts or not?

C Abernathy
  • 5,533
  • 1
  • 22
  • 27
1

I was having the same problem. This answer helped me: Facebook ios sdk 3.0 active session FBiOSSDK error2

Briefly, I was trying to login to a sandbox mode FB app with a tester account. Try an admin account and/or make sandbox off.

Community
  • 1
  • 1
mentat
  • 2,748
  • 1
  • 21
  • 40
  • +1 for making sure the Facebook user you are trying to post through is registered with the app, or making sure that sandbox mode is off. – meddlingwithfire Feb 07 '13 at 19:14
0

This is what worked for me:

  1. Deleted facebook account in IOS Settings
  2. logged out of facebook app and deleted from iPhone
  3. Logged out of facebook messenger and deleted app from iPhone
  4. Redeployed my app to my iPhone

Problem solved finally after days of googling for com.facebook.sdk error

My bundle id in the build settings and plist don't match by the way.....

On reinstalling the facebook app, and then trying to login to FB from my app I got a message telling me to set my bundle id in developer.facebook.com/app so it may have been that problem before, but i'm not sure since i could login to fb from my app after taking the steps above.

Kelvin U
  • 353
  • 4
  • 15