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:
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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…