Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

com.facebook.sdk error 2 occurs when login to Facebook

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>
like image 505
Seho Lee Avatar asked Nov 16 '12 09:11

Seho Lee


People also ask

What does SDK mean in Facebook?

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.


2 Answers

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

like image 198
Daniel Albert Avatar answered Oct 12 '22 23:10

Daniel Albert


Sign out of facebook app from the settings and then try.

This worked for me.

like image 27
aToz Avatar answered Oct 12 '22 22:10

aToz