facebookConnectPlugin getting two time success call

134 views Asked by At

I am using cordova facebookConnectPlugin in iOS app.

I am trying to login and fetch the user data, but fbLoginSuccess fires two times. Which means facebookConnectPlugin.login responding two times back to back and I'm not able to find where is the mistake and how to handle this issue.

      var fbLoginSuccess = function (userData) {
           alert("UserInfo:");
           alert("UserInfo: " + JSON.stringify(userData));
    facebookConnectPlugin.api("me/?fields=id,email,first_name,last_name",["user_birthday"],function (response) {

                                              alert(JSON.stringify(response));
                                     });

           }

          facebookConnectPlugin.login(["public_profile"],fbLoginSuccess,function (error) { alert(error) }

           );
0

There are 0 answers