Error In Success Callback Com.phonegap.facebook.connect
Sign in Pricing Blog Support Search GitHub This repository Watch 145 Star 1,887 Fork 1,615 Wizcorp/phonegap-facebook-plugin Code Issues 370 Pull requests 23 Projects 0 Pulse Graphs New issue How to set a callback when a user cancels a login request #288 Closed rbahumi opened this Issue May 30, 2013 · 7 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 5 participants rbahumi commented May 30, 2013 Hi, The FB.login() in Facebook's Javascript SDK also detects when a user cancels a login request. My login callback is only being called when a user confirm the permissions, never when he/she cancels the login request. Here is and example from Facebook's documentation: FB.login(function(response) { if (response.authResponse) { console.log('Welcome! Fetching your information.... '); FB.api('/me', function(response) { console.log('Good to see you, ' + response.name + '.'); }); } else { console.log('User cancelled login or did not fully authorize.'); } }); I am asking this because I am adding a loading spinner to the login button, and the spinner should be removed when either, a successful login occurs or a user cancels the login request. Can this behavior also be achieved with this plugin? Roei scyclops commented May 30, 2013 I'd also like to have this behavior available. rbahumi commented May 30, 2013 I have found a workaround for this.... I don't treat the FB.login() function as the actual login function... Instead, I treat calls to FB.api('/me' ...) as my actual login function. In my scenario, it is kind of equivalent. Hope that helps. sebastianzillessen commented Jun 22, 2013 How do you do this then? I really need this feature as well. A loading spinner is needed in my application but the app does not receive a callback on iOS when the user cancels the permission request. I hope someone can help me with this. Thanks! jakeonrails commented Jun 27, 2013 👍 this is really important! jakeonrails commented Jun 27, 2013 In the cordova facebook javascript there is this replacement for the fb login method: login: function(params, cb, fail) { params = params || { scope: '' }; cordova.exec(function(e) { // login if (e
Sign in Pricing Blog Support Search GitHub This repository Watch 145 Star 1,887 Fork 1,615 Wizcorp/phonegap-facebook-plugin Code Issues 370 Pull requests 23 Projects 0 Pulse Graphs New issue Success callback function not getting called on success login on Android. #449 Closed jackychow opened this Issue Apr 11, 2014 · 2 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 2 participants jackychow commented https://github.com/Wizcorp/phonegap-facebook-plugin/issues/288 Apr 11, 2014 This is based on the revamped plugin facebookConnectPlugin.js. The code is this simple line (as in the documentation) and this is being run in Android. 4.3. FacebookConnectPlugin.login(["basic_info"], function(userData){ console.log("UserInfo: "+JSON.stringify(userData)); }, function(error){ console.log(""+error); } ); So apparently the actual login and permission granting succeed as seen from log printed from the https://github.com/Wizcorp/phonegap-facebook-plugin/issues/449 native plugin code. I see the log from "ConnectPlugin" "returning login object {id: ................................. }" which is my facebook user info. But the success callback function was not called at all, neither was the error callback function. Can anybody give some pointer as for what might be wrong? I'm running my code with sencha touch 2... but I think that shouldn't make a difference, right? jackychow commented Apr 12, 2014 OK, in case somebody else has similar issue as well .... turns out I included the codes cordova.js and phonegap.js repeatedly ... sencha touch uses phonegap and while I created the project with cordova.js and included both scripts in index.html, this messed up the asynchronous "mechanism" in cordova big time. Turns out both copies got initialized and both registered a global event handler on the same events used for async callback ...... and then different "cordova" instance's handler got called when the callback comes back .... and the error totally
Cordova >= 5.0.0 iOS and Android Login, Graph Requests, App Events Get the Plugin: $> cordova plugin add cordova-plugin-facebook --variable FACEBOOK_DISPLAY_NAME=