Socialid.login.logoutWithFacebook

From Social ID Developers
(Difference between revisions)
Jump to: navigation, search
(Description)
(API Response)
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
 
== Description ==
 
== Description ==
  
Chama a API para deslogar o usuário atualmente logado no Social Login através do Login Automático pelo Facebook.
+
API to logout the user previously logged in by the Facebook Automatic Login.
  
É importante salientar que esta API também desloga o usuário do Facebook, uma vez que usa a API FB.logout() do SDK Javascript do Facebook. Desta forma, o usuário não conseguirá realizar login automático pelo Facebook até que se logue novamente na rede social.
+
This API also logs out the user from Facebook, since it uses the FB.logout() API from Facebook Javascript SDK. Thus, the user can not perform the Facebook Automatic Login again until he log back on the social network.
  
 
== Usage ==
 
== Usage ==
Line 13: Line 13:
 
{|
 
{|
 
! align="left" width="200px" | handler
 
! align="left" width="200px" | handler
| width="200px" | opcional
+
| width="200px" | optional
| Especifica uma função de callback para tratar a resposta da API.
+
| Callback function to handle the API response.
 
|}
 
|}
  
Line 21: Line 21:
 
{|
 
{|
 
! align="left" width="200px" | data
 
! align="left" width="200px" | data
| Sempre "null". Esta API não retorna dados.
+
| Always "null". This API does not return data.
 
|+
 
|+
 
! align="left" width="200px" | status
 
! align="left" width="200px" | status
| O status da execução da chamada da API. Pode ser "success", se o logout foi realizado com sucesso, ou "not_found", caso não exista um usuário logado na sessão atual.
+
| The API response status. Can be '''success''', if logout the user successfully, or '''not_found''', if there is no user logged in the current login session.
 
|}
 
|}
  
 
== Example ==
 
== Example ==
  
Desloga o usuário da sessão atual:
+
Logout the user from the current login session (and also from Facebook):
  
 
   socialid.login.init(1);
 
   socialid.login.init(1);
 
   var handler = function(response) {
 
   var handler = function(response) {
 
     if (response.status == "success") {
 
     if (response.status == "success") {
         alert("Você foi deslogado com sucesso!");
+
         alert("You have been logged out successfully!");
 
     } else {
 
     } else {
         alert("Não foi possível deslogar.");
+
         alert("Could not log out.");
 
     }
 
     }
 
   }
 
   }
 
   socialid.login.logoutWithFacebook(handler);
 
   socialid.login.logoutWithFacebook(handler);
  
Teste as APIs em nosso playground: https://sid-examples.herokuapp.com/social_logins/playground
+
You can test this parameters in our playground: https://sid-examples.herokuapp.com/social_logins/playground

Latest revision as of 13:14, 4 November 2014

Contents

Description

API to logout the user previously logged in by the Facebook Automatic Login.

This API also logs out the user from Facebook, since it uses the FB.logout() API from Facebook Javascript SDK. Thus, the user can not perform the Facebook Automatic Login again until he log back on the social network.

Usage

 socialid.login.logoutWithFacebook(handler)

Parameters

handler optional Callback function to handle the API response.

API Response

data Always "null". This API does not return data.
status The API response status. Can be success, if logout the user successfully, or not_found, if there is no user logged in the current login session.

Example

Logout the user from the current login session (and also from Facebook):

 socialid.login.init(1);
 var handler = function(response) {
    if (response.status == "success") {
       alert("You have been logged out successfully!");
    } else {
       alert("Could not log out.");
    }
 }
 socialid.login.logoutWithFacebook(handler);

You can test this parameters in our playground: https://sid-examples.herokuapp.com/social_logins/playground

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox