android - Prompting a login only once -



android - Prompting a login only once -

i have video player app. when video clicked user prompted login facebook business relationship using code below:

if(videocode == "bqxtccyjske"){ $(document).ready(function () { login() }); }

the login function works fine when same video thumbnail clicked again, of course of study login process runs again, produces error. out there know of way take care of this? either through boolean logic or through facebook api? api code , called function both below.

<div id="fb-root"></div> <script type="text/javascript"> //<![cdata[ window.fbasyncinit = function() { fb.init({ appid : '410375775693910', // app id channelurl : '', // channel file, not required leave empty status : true, // check login status cookie : true, // enable cookies allow server access session oauth : true, // enable oauth 2.0 xfbml : false // parse xfbml }); }; // logs user in application , facebook function login(){ fb.getloginstatus(function(r){ if(r.status === 'connected'){ window.location.href = 'fbconnect.php'; }else{ fb.login(function(response) { if(response.authresponse) { //if (response.perms) window.location.href = 'fbconnect.php'; } else { // user not logged in } },{scope:'email'}); // info access user profile } }); } // load sdk asynchronously (function() { var e = document.createelement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_us/all.js'; document.getelementbyid('fb-root').appendchild(e); }()); //]]> </script>

android facebook login

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -