Skip to main content
Version: 5.7.0

SendEvent

Sends an event to the designated profile id with the attached JSON data.

Any events that have been sent to a user will show up in their incoming event queue.

tip

Note that the list of sent and incoming events for a user is also returned in the "ReadUserState" call (in the UserState module).

ServiceOperation
eventSEND

Method Parameters

ParameterDescription
toProfileIdThe id of the player who is being sent the event
eventTypeThe user-defined type of the event.
eventDataThe user-defined data for this event encoded in JSON.

Usage

http://localhost:3000
string toId = "profile1";
string eventType = "type1";
string eventData = "{\"someMapAttribute\":\"someValue\"}";
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};

_bc.EventService.SendEvent(toId, eventType, eventData, successCallback, failureCallback);
JSON Response
{
"status": 200,
"data": {
"evId": "1234-1234-1234-1234"
}
}