I am trying to use Facebook plugin for phone gap but getting error message
"the operation couldn't be completed com.facebook.error 2"
I guess my bundle identifier does not match for Facebook but I am not sure
what I missed for bundle identifier match... check if my code missing
something for bundle identifier matching?
deviceready function :
document.addEventListener('deviceready', function() {
try {
alert('Device is ready! Make sure you set your app_id below this alert.');
FB.init({ appId: "120048634820284", nativeInterface: CDV.FB, useCachedDialogs: false });
document.getElementById('data').innerHTML = "";
} catch (e) {
alert(e);
}
}, false);
info.plist file
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.mycompany.myapp</string>
<key>CFBUndleURLSchemes</key>
<array>
<string>fb120048634820284</string>
</array>
</dict>
</array>
The Facebook SDK is a set of software components that developers can include in their mobile app to understand how people use the app, run optimized marketing campaigns and enable Facebook login and social sharing. This course helps you understand the purpose of the Facebook SDK and App Events for Android and iOS.
I had the same error and finally solved it. The app was configured on Sandbox mode and the facebook user I was using wasn't added to testers group.
An administrator can solve it here: https://developers.facebook.com/apps
Sign out of facebook app from the settings and then try.
This worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With