ScheduleRichPushNotificationMinutes
Schedules a rich push notification to a user at a future relative time.
Service | Operation |
---|---|
pushNotification | SCHEDULE_RICH_NOTIFICATION |
Method Parameters
Parameter | Description |
---|---|
profileId | Identifies the user to send to |
notificationTemplateId | Id of the notification template |
substitutions | JSON defining the substitution params to use with the template |
minutesFromNow | Minutes in the future to send notification |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string profileId = "kjhkjhgfkjshgkjh";
int notificationTemplateId = 1;
string substitutionJson = "{\"0\":\"value0\",\"1\":\"value1\"}";
int minutesFromNow = 1;
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.PushNotification.ScheduleRichPushNotificationMinutes(profileId, notificationTemplateId, substitutionJson, minutesFromNow, successCallback, failureCallback);
const char *profileId = "kjhkjhgfkjshgkjh";
int notificationTemplateId = 1;
const char *substitutionJson = "{\"0\":\"value0\",\"1\":\"value1\"}";
int minutesFromNow = 1;
_bc->getPushNotification()->scheduleRichPushNotificationMinutes(profileId, notificationTemplateId, substitutionJson, minutesFromNow, this);
NSString *profileId = @"kjhkjhgfkjshgkjh";
int notificationTemplateId = 1;
NSString *substitutionJson = @"{\"0\":\"value0\",\"1\":\"value1\"}";
int minutesFromNow = 1;
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc pushNotificationService] scheduleRichPushNotificationMinutes:profileId
notificationTemplateId:notificationTemplateId
substitutionJson:substitutionJson
minutesFromNow:minutesFromNow
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String profileId = "kjhkjhgfkjshgkjh";
int notificationTemplateId = 1;
String substitutionJson = "{\"0\":\"value0\",\"1\":\"value1\"}";
int minutesFromNow = 1;
this; // implements IServerCallback
_bc.getPushNotification().scheduleRichPushNotificationMinutes(profileId, notificationTemplateId, substitutionJson, minutesFromNow, 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 profileId = "kjhkjhgfkjshgkjh";
var notificationTemplateId = 1;
var substitutionJson = {
"0": "value0",
"1": "value1"
};
var minutesFromNow = 1;
_bc.pushNotification.scheduleRichPushNotificationMinutes(profileId, notificationTemplateId, substitutionJson, minutesFromNow, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var profileId = "kjhkjhgfkjshgkjh";
var notificationTemplateId = 1;
var substitutionJson = {
"0": "value0",
"1": "value1"
};
var minutesFromNow = 1;
ServerResponse result = await _bc.pushNotificationService.scheduleRichPushNotificationMinutes(profileId:profileId, notificationTemplateId:notificationTemplateId, substitution:substitutionJson, minutesFromNow:minutesFromNow);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var profileId = "kjhkjhgfkjshgkjh";
var notificationTemplateId = 1;
var substitutionJson = {
"0": "value0",
"1": "value1"
};
var minutesFromNow = 1;
var pushNotificationProxy = bridge.getPushNotificationServiceProxy();
var postResult = pushNotificationProxy.scheduleRichPushNotificationMinutes(profileId, notificationTemplateId, substitutionJson, minutesFromNow);
if (postResult.status == 200) {
// Success!
}
{
"service": "pushNotification",
"operation": "SCHEDULE_RICH_NOTIFICATION",
"data": {
"profileId": "kjhkjhgfkjshgkjh",
"notificationTemplateId": 1,
"substitutions": {
"0": "value0",
"1": "value1"
},
"startDateUTC": "[[#ts+60000]]"
}
}