SysInitializePresence
Creates or updates the presence of \<profileId>. \<visible> is optional (defaults to true). \<activity> is optional. \<expirySecs> is optional (defaults to brainCloud property \<presPxExpirySecs>).
Service | Operation |
---|---|
presence | SYS_INITIALIZE_PRESENCE |
Method Parameters
Parameter | Description |
---|---|
profileId | Target profile id. |
visible | Should user appear in presence? True by default. |
activity | Presence activity record json. Size of the given activity must be equal to or less than the Max content size (bytes) app setting (see Messaging > Presence in the portal.) |
expirySecs | Number of seconds before expiry. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
var profileId = "aaa-bbb-ccc-ddd";
var visible = true;
var activity = {};
var expirySecs = 300;
var presenceProxy = bridge.getPresenceServiceProxy();
var postResult = presenceProxy.sysInitializePresence(profileId, visible, activity, expirySecs);
if (postResult.status == 200) {
// Success!
}
{
"service": "presence",
"operation": "SYS_INITIALIZE_PRESENCE",
"data": {
"profileId": "aaa-bbb-ccc-ddd",
"visible": true,
"activity": {},
"expirySecs": 300
}
}