ScheduleRichPushNotifications
Schedules rich notifications based on user local time.
Example of substitution usage:
Message could be You have won a {2} for entering the {1} contest
.
Substitutions parameter would be { "1" : "User Appreciation", "2", "User Appreciation Prize" }
Results
Name | Description |
---|---|
notificationJobs | Number of notification jobs/time zones targeted |
Service | Operation |
---|---|
pushNotification | SCHEDULE_RICH_NOTIFICATIONS |
Method Parameters
Parameter | Description |
---|---|
notificationTemplateId | Identifies the template that will determine the message content. |
segmentIdList | List of target segments. Omit to send to all users. |
substitutions | Positional message substitution values. |
startDateUTC | Optional base date for local time calculation. |
localTime | The scheduled local arrival time. |
minimizeJobs | Optional flag to cause the server to scan players time zones to reduce scope. |
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 notificationTemplateId = 1;
var substitutions = {
"0": "value0",
"1": "value1"
};
var segmentIdList = [
1,
2
];
var localTime = "15:00";
var minimizeJobs = true;
var startDateUTC = 1437579786000;
var pushNotificationProxy = bridge.getPushNotificationServiceProxy();
var postResult = pushNotificationProxy.scheduleRichPushNotifications(notificationTemplateId, segmentIdList, substitutions, startDateUTC, localTime, minimizeJobs);
if (postResult.status == 200) {
// Success!
}
{
"service": "pushNotification",
"operation": "SCHEDULE_RICH_NOTIFICATIONS",
"data": {
"notificationTemplateId": 1,
"segmentIdList": [
1,
2
],
"substitutions": {
"0": "value0",
"1": "value1"
},
"startDateUTC": 1437579786000,
"localTime": "15:00",
"minimizeJobs": true
}
}
JSON Response
{
"packetId": 1,
"messageResponses": [
{
"status": 200,
"data": {
"notificationJobs": 4
}
}
]
}