javascript - Facebook phonegap permissions pop not only on app start -
i managed facebook plugin running on cordova phonegap project work when it's on index.js file such as:
bindevents: function() { document.addeventlistener('deviceready', this.ondeviceready, false); document.addeventlistener('deviceready', initapp, false); var fbloginsuccess = function (userdata) { getuserinfo(); } function initapp() { facebookconnectplugin.login(["public_profile"], fbloginsuccess, function (error) { alert("" + error) } ); } function getuserinfo(){ facebookconnectplugin.api('/me', null, function(response) { alert('good see you, ' + response.name + '.'); }); } },
i want run when user clicks facebook login button , not on start of app, if place function call inside .html file ou main.js have undefined function; works inside bindevents , else... appreciated thks.
Comments
Post a Comment