Log In
Status:
waiting
|
Disconnect
|
Logout
<button class="btn" id="fb-login-status">FB.getLoginStatus()</button> <button class="btn" id="fb-login-status-force">FB.getLoginStatus() force=true</button> <button class="btn" id="fb-get-auth-response">FB.getAuthResponse()</button> <button class="btn" id="fb-login">FB.login()</button> <button class="btn" id="fb-permissions">FB.login() with Permissions</button> <button class="btn" id="fb-logout">FB.logout()</button> <script> FB.Event.subscribe('auth.login', function(response) { Log.info('auth.login event handler', response); }); FB.Event.subscribe('auth.logout', function(response) { Log.info('auth.logout event handler', response); }); FB.Event.subscribe('auth.statusChange', function(response) { Log.info('auth.statusChange event handler', response); }); FB.Event.subscribe('auth.authResponseChange', function(response) { Log.info('auth.authResponseChange event handler', response); }); document.getElementById('fb-login-status').onclick = function() { FB.getLoginStatus(function(response) { Log.info('FB.getLoginStatus callback', response); }); }; document.getElementById('fb-login-status-force').onclick = function() { FB.getLoginStatus(function(response) { Log.info('FB.getLoginStatus force=true callback', response); }, true); }; document.getElementById('fb-get-auth-response').onclick = function() { Log.info('FB.getAuthResponse', FB.getAuthResponse()); }; document.getElementById('fb-login').onclick = function() { FB.login(function(response) { Log.info('FB.login callback', response); }); }; document.getElementById('fb-permissions').onclick = function() { FB.login( function(response) { Log.info('FB.login with permissions callback', response); }, { scope: 'manage_pages' } ); }; document.getElementById('fb-logout').onclick = function() { FB.logout(function(response) { Log.info('FB.logout callback', response); }); }; </script>
Examples
Website
Website
Canvas
Page Tab
Run Code
Clear