Try OpenEdge Now
skip to main content
Online Help
Data Object overview : Reference : Push notification API reference : OpenEdge.Mobile.TelerikPushNotificationAdmin API
 
OpenEdge.Mobile.TelerikPushNotificationAdmin API
You can also use the OpenEdge.Mobile.TelerikPushNotificationAdmin API to allow an administrator to get, modify or delete notifications, send normal push notifications, and get the number of devices registered. The administrator would require an API key and the API Master key (both are available in the Telerik Platform backend settings). These values are passed to the constructor, with an optional URL. If a URL is not passed as an argument, the default URL of http://api.everlive.com/v1/ is used. It includes the following:
Methods
Fully qualified name
Description
GetNotifications
public JsonObject GetNotifications(input poFilter as JsonObject) method public JsonObject GetNotifications()
Returns all notifications for the master key relevant to the provided filter. The data is returned as a JsonObject containing the notifications details, including an Id property. The filter argument is in JSON form.
Note: For more details about how to construct the filter, see the Telerik documentation (http://docs.telerik.com).
UpdateNotification
public void UpdateNotification(input pcNotificationId as character, input poUpdateValue as JsonObject).
Modifies the payload of a single notification. This method uses a notification Id (typically obtained from a GetNotifications call) and a JSON object containing the values to update in the notification.
This JSON should be structured according to the format as specified in
DeleteNotification
public void DeleteNotification(input pcNotificationId as character)
Deletes a notification from the server. The method uses a notification Id (typically obtained from a GetNotifications call).
GetDevices
public JsonObject GetDevices(input poFilter as JsonObject) method public JsonObject GetDevices()
Returns information about all devices for the master key relevant to the provided filter. The filter argument is in JSON form.
Note: For more details about how to construct the filter, see the Telerik documentation (http://docs.telerik.com).
GetDeviceCount
public integer GetDeviceCount()
Returns the count of all the devices that are currently registered for push notifications with Telerik Backend Services.
Here is an example of the OpenEdge.Mobile.TelerikPushNotificationAdmin API for getting notifications and viewing the number of devices registered:
BLOCK-LEVEL ON ERROR UNDO, THROW.

USING OpenEdge.Mobile.TelerikPushNotificationAdmin FROM PROPATH.
USING Progress.Json.ObjectModel.JsonObject FROM PROPATH.

DEFINE VARIABLE oAdminSvc AS TelerikPushNotificationAdmin NO-UNDO.
DEFINE VARIABLE oResult AS JsonObject NO-UNDO.
DEFINE VARIABLE iLoop AS INTEGER NO-UNDO.


oAdminSvc = NEW TelerikPushNotificationAdmin(
'<api key>', /* api */
'<master key>' /* master */
).
oAdminSvc:Initialize().

oResult = oAdminSvc:GetNotifications(NEW JsonObject()).

oResult:writefile('notifications.json', TRUE).

iLoop = oAdminSvc:GetDeviceCount().

MESSAGE "Number of registered devices: " iLoop
VIEW-AS ALERT-BOX.