I have a Phonegap app that runs on both iOS and Android. The app has a Facebook login feature which worked until a few days ago. A few of our beta testers have reported an 'The operation couldn't be completed com.facebook.sdk error 2' error. The devices of these testers vary: iPhone 5, iPhone 4s, iPod Touch, iOS 5.1.1 and iOS 6.0.
We use the latest Facebook SDK and a Phonegap Facebook login plugin (https://github.com/davejohnson/phonegap-plugin-facebook-connect/).
I've done some research and found the following reasons why this error could occur:
- BundleIdentifier and BundleURLName in my info.plist file don't match the Bundle ID under Native iOS app in the settings of my Facebook app.
- The app is still in Sandbox mode
- The app is disabled in the Facebook Settings (device's settings -> Facebook -> Allow These Apps To Use Your Account).
- iOS 6.0 doesn't allow for the asking of read and write permissions at the same time (not sure if I have this right).
The following is the case:
- The BundleIdentifier and BundleURLName match.
- The app isn't in Sandbox mode.
- The app doesn't appear in 'Allow These Apps To Use Your Account' of every user
- The builders of the Phonegap plugin said to have fixed the iOS 6.0 permissions bug (https://github.com/davejohnson/phonegap-plugin-facebook-connect/pull/216)
It's a very inconsistent bug (in my case). I can only reproduce the error myself if I switch off the app in 'Allow These Apps To Use Your Account' (in my case the app is listed there), but I can easily fix the error by allowing the app again. At the moment most of the testers don't have this bug (anymore), but the error remains on an iPod (where the app isn't listed in 'Allow These Apps To Use Your Account' either).
Does anyone have any idea why I'm having this bug?