CloudBuilder  2.8.4
Making social games is easy !
Functions
Login related tasks

Functions

void CloudBuilder::CUserManager::LoginAnonymous (CResultHandler *aHandler)
 
void CloudBuilder::CUserManager::LoginNetwork (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler)
 
void CloudBuilder::CUserManager::ResumeSession (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler)
 
void CloudBuilder::CUserManager::Logout (CResultHandler *aHandler)
 
void CloudBuilder::CUserManager::Link (const char *aNetwork, CResultHandler *aHandler)
 
void CloudBuilder::CUserManager::Unlink (const char *aNetwork, CResultHandler *aHandler)
 
void CloudBuilder::CUserManager::Convert (const char *aNetwork, CResultHandler *aHandler)
 

Detailed Description

Function Documentation

void CloudBuilder::CUserManager::Convert ( const char *  aNetwork,
CResultHandler aHandler 
)

Can convert the current account to a Facebook, Googleplus or GameCenter account. To be done only when being logged in with an anonymous account.

Parameters
aNetworkis a string containing the network : "facebook", "googleplus", "gamecenter"
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain : "done" : 1
void CloudBuilder::CUserManager::Link ( const char *  aNetwork,
CResultHandler aHandler 
)

Method used to Link an account with Facebook, Googleplus, GameCenter.

Parameters
aNetworkis a string containing the network : "facebook", "googleplus", "gamecenter"
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain : "done" : 1
void CloudBuilder::CUserManager::LoginAnonymous ( CResultHandler aHandler)

Method used to login using no identifer. This method will fail (enOperationAlreayInProgress) if any other login related operation is already launched.

Parameters
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain : "gamer_id" : "xxxxx", "gamer_secret" : "xxxxxx" "profile" : {}
void CloudBuilder::CUserManager::LoginNetwork ( const CotCHelpers::CHJSON aConfiguration,
CResultHandler aHandler 
)

Method used to log in with a with an account of a social network. This method will fail (enOperationAlreayInProgress) if any other login related operation is already launched.

Parameters
aConfigurationis a JSON object holding the necessary connection details. The mandatory keys are:
  • "network" : facebook, googleplus, gamecenter, email when network=email, then others needed keys are
  • "id" : string containing the ID of the user.
  • "secret" : string containing the secret associated with the user ID.

optionally pass an 'options' key which may contain:

  • 'preventRegistration' : doesn't create a new account if not already existing. In this it can raise an error named 'PreventRegistration'.
Parameters
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain : "gamer_id" : "xxxxx", "gamer_secret" : "xxxxxx" "profile" : {}
void CloudBuilder::CUserManager::Logout ( CResultHandler aHandler)

Method used to log out a previously logged in profile. After calling this, you need to log again using any of LoginAnonymous, LoginNetwork or Login before being able to call other methods.

Parameters
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain : "done" : 1
void CloudBuilder::CUserManager::ResumeSession ( const CotCHelpers::CHJSON aConfiguration,
CResultHandler aHandler 
)

Method used to log in with a profile previously stored as the result of a LoginAnonymous or LoginNetwork. This method will fail (enOperationAlreayInProgress) if any other login related operation is already launched.

Parameters
aConfigurationis a JSON object holding the necessary connection details. The mandatory keys are:
  • "id" : string containing the ID of the user.
  • "secret" : string containing the secret associated with the user ID.
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain : "gamer_id" : "xxxxx", "gamer_secret" : "xxxxxx" "profile" : {}
void CloudBuilder::CUserManager::Unlink ( const char *  aNetwork,
CResultHandler aHandler 
)

Method used to Unlink an account with Facebook, Googleplus, GameCenter.

Parameters
aNetworkis a string containing the network : "facebook", "googleplus", "gamecenter"
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain : "done" : 1