METHOD_ScheduleNotification
This method enables a BlackBerry Connect client session to schedule a silent notification that is sent to a client at a scheduled time to process when the client is in the background. This notification allows the client to respond when it receives a remote notification (for example, a wakeup call to maintain session keepalive or a notification prior to the Windows access token expiration). This method is not supported for GNP notifications.
The following table describes the parameters that you can include in this method.
|
Parameter |
Type | Required |
Description |
|---|---|---|---|
|
scheduleAt |
Integer | √ |
This parameter specifies the server relative time when the ScheduleNotification is sent to the client (for example, UTC ms since 1970/01/01). |
| tag | String | √ |
This parameter is a client specified value that indicates the type of notification. The client can schedule multiple notifications, but each notification must have unique tags. Use descriptive names for the tags. For example,
|
| clientData | json dictionary object | — | This optional parameter is a json dictionary object, that when it is available, is included in the notification payload request to BEMS.
Note: For Android devices, the FCM format allows string values within the data. The client string encodes the clientData when it sends the request to BEMS.
|
Code sample
{
"id":"c3"
"method":"ScheduleNotification",
"params":
{
"scheduleAt":"1551522681",
"tag":"session_keepalive",
"clientData":
{
"task1":"wake up",
"task2":"keep session alive"
}
},
"jsonrpc":"2.0"
}
{
"id":"c3",
"error":"null",
"result":
{
"data":
{
"method":"ScheduleNotification",
"state":"COMPLETE"
}
},
"jsonrpc":"2.0"
}
- On an iOS device,
{ "aps": { content-available = 1 } "custom": { "ts":"1551522681", "tag":"session_keepalive", "clientData" { "task1":"wake up", "task2":"keep session alive" } }, "jsonrpc":"2.0" } - On an Android device,
"data": { "params": { "scheduleAt":"1551522681", "tag":"session_keepalive", "clientData": { "task1":"wake up", "task2":"keep session alive" } }, "jsonrpc":"2.0" }