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

Functions

void CloudBuilder::CUserManager::RegisterEventListener (const char *aDomain, CEventListener *aListener)
 
void CloudBuilder::CUserManager::UnregisterEventListener (const char *aDomain, CEventListener *aListener)
 
void CloudBuilder::CUserManager::PushEvent (const char *aDomain, const char *aGamerID, const CotCHelpers::CHJSON *aEvent, const CotCHelpers::CHJSON *aNotification, CResultHandler *aHandler)
 

Detailed Description

Function Documentation

void CloudBuilder::CUserManager::PushEvent ( const char *  aDomain,
const char *  aGamerID,
const CotCHelpers::CHJSON aEvent,
const CotCHelpers::CHJSON aNotification,
CResultHandler aHandler 
)

Method to be called to setup a listener on a domain.

Parameters
aDomainis the domain (ie channel) to watch
aGamerIDthe user to notify
aEventthe data to transmit (free form json)
aNotificationan optionnal json which describe the OS notification to be displayed is the app is in background It should be of the form { "en" : "I need help!", "fr" : "J'ai desoin d'aide"} the size of the localized message should be less than 100 char and will be truncated. the lang code is ISO-639-1. Apply Cloudbuilder::CUserManager::SetProfile with 'lang', preferred language, should be set with this ISO code.If 'lang' is no set, or the code not found in the aNotification, then, the 'en' will de displayed. If even 'en' is not found, a cloudbuilder default message will be displayed. If NULL is passed, no notification will be displayed. aNotification can optionnaly contains a "data" field that will be part of the os notification, but the size of this field plus the localized message should be less than 100 character (this is due to os constraint).
aHandlerresult handler whenever the call finishes (it might also be synchronous)
void CloudBuilder::CUserManager::RegisterEventListener ( const char *  aDomain,
CEventListener aListener 
)

Method to be called to setup a listener on a domain.

Parameters
aDomainis the domain (ie channel) to watch
aListenerwill be called when an event will be available on this domain. The listener is a CRefClass, so if you don't need it, you can call Release(). The system will keep it as long as needed and free it then, as shown below. CEventListener *listener = new MyListenerObject; RegisterEventListener("domain", listener); listener->Release(); Adversely, do not delete the listener object once registered. Unregister it before or call Release(), which will do nothing if it is still retained elsewhere.
void CloudBuilder::CUserManager::UnregisterEventListener ( const char *  aDomain,
CEventListener aListener 
)

Unregisters a previously registered event listener. Does nothing if the event listener wasn't actually registered for the matching domain.

Parameters
aDomainis the domain (ie channel) to watch
aListenera previously registered event listener