CustomScreenEvent
Creates custom data stream screen event
Service | Operation |
---|---|
dataStream | CUSTOM_SCREEN_EVENT |
Method Parameters
Parameter | Description |
---|---|
eventName | The name of the event |
eventProperties | The properties of the event |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string eventName = "customEvent";
string jsonEventProperties = "{\"key1\":\"value\",\"key2\":\"value\"}";
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.DataStreamService.CustomScreenEvent(eventName, jsonEventProperties, successCallback, failureCallback);
const char *eventName = "customEvent";
const char *jsonEventProperties = "{\"key1\":\"value\",\"key2\":\"value\"}";
_bc->getDataStreamService()->customScreenEvent(eventName, jsonEventProperties, this);
NSString *eventName = @"customEvent";
NSString *jsonEventProperties = @"{\"key1\":\"value\",\"key2\":\"value\"}";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc dataStreamService] customScreenEvent:eventName
jsonEventProperties:jsonEventProperties
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String eventName = "customEvent";
String jsonEventProperties = "{\"key1\":\"value\",\"key2\":\"value\"}";
this; // implements IServerCallback
_bc.getDataStreamService().customScreenEvent(eventName, jsonEventProperties, this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
var eventName = "customEvent";
var jsonEventProperties = {
"key1": "value",
"key2": "value"
};
_bc.dataStream.customScreenEvent(eventName, jsonEventProperties, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var eventName = "customEvent";
var jsonEventProperties = {
"key1": "value",
"key2": "value"
};
ServerResponse result = await _bc.dataStreamService.customScreenEvent(eventName:eventName, jsonEventProperties:jsonEventProperties);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var eventName = "customEvent";
var jsonEventProperties = {
"key1": "value",
"key2": "value"
};
var dataStreamProxy = bridge.getDataStreamServiceProxy();
var postResult = dataStreamProxy.customScreenEvent(eventName, jsonEventProperties);
if (postResult.status == 200) {
// Success!
}
{
"service": "dataStream",
"operation": "CUSTOM_SCREEN_EVENT",
"data": {
"eventName": "customEvent",
"eventProperties": {
"key1": "value",
"key2": "value"
}
}
}
JSON Response
{
"status": 200,
"data": null
}