SendNormalizedPushNotificationToGroup
Sends a notification to a "group" of user consisting of alert content and custom data.
See the Portal documentation for more info.
Service | Operation |
---|---|
pushNotification | SEND_NORMALIZED_TO_GROUP |
Method Parameters
Parameter | Description |
---|---|
groupId | The target group. |
senderId | Optional id of sender. |
alertContent | Body and title of alert. |
customData | Optional custom data. |
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 groupId = "group1";
var senderId = "playerId";
var alertContent = {
"body": "content of message",
"title": "message title"
};
var customData = {
"field1": "value1",
"field2": "value2"
};
var pushNotificationProxy = bridge.getPushNotificationServiceProxy();
var postResult = pushNotificationProxy.sendNormalizedPushNotificationToGroup(groupId, senderId, alertContent, customData);
if (postResult.status == 200) {
// Success!
}
{
"service": "pushNotification",
"operation": "SEND_NORMALIZED_TO_GROUP",
"data": {
"groupId": "group1",
"senderId": "playerId",
"alertContent": {
"body": "content of message",
"title": "message title"
},
"customData": {
"field1": "value1",
"field2": "value2"
}
}
}
JSON Response
{
"packetId": 1,
"messageResponses": [
{
"status": 200,
"data": null
}
]
}