Namespace: OpenEdge.Mobile
Class 
ApperyPushNotificationService
Parent classes:
Inherits: OpenEdge.Mobile.PushNotificationService

Copyright (c) 2015 by Progress Software Corporation. All rights reserved.
File:ApperyPushNotificationService
Purpose:Sends push notifications to a device or devices.
Author(s):pjudge
Created:Mon Feb 10 16:41:36 EST 2014
Notes:* Doc at http://docs.mobile.rollbase.com/documentation/backendservices/push/
requests, see the JSON generated when using the
"Devices filtered using query builder" functionality in the
Push Notifications / Send push notification page at
https://mobile.rollbase.com/push/.
to the according URL. �filter� is the optional parameter, when
it�s empty Push Notification is sent to all devices.
�schedule� is the optional parameter, when it�s not empty
Push Notification can be scheduled.
curl -X POST \
-H "X-Appery-Push-API-Key:<pushAPIKey>" \
-H "Content-Type: application/json" \
-d '{"payload":{"message" : <message>, "badge" : <badge>}[, "filter" : {"deviceID" : <deviceID criteria>,"<param1>" : <criteria>, ...}][, "schedule": {"scheduledTime": <scheduled_time>, "useTimeZone": <use_time_zone>}]}' \
https://api.appery.io/rest/push/msg
where:
<pushAPIKey> is a unique key, issued by server, which allows sending Push Notifications;
<message> is the message text (mandatory);
<badge> is the number shown with app icon in iOS (optional, if empty - badge is not changed on device);
<deviceID criteria> is deviceID criteria for searching device;
<param1> is a custom field of _devices table;
<criteria> is param1 criteria for searching device;
<scheduled_time> is the date when Push Notification should be sent (it is always truncated to minute);
<use_time_zone> is a boolean parameter indicating whether Push Notification should be sent in device time zone.
If Push Notification is scheduled, server returns HTTP 200 and list of saved Push Notifications, else server returns HTTP 204 NO CONTENT status even if no messages were sent or delivered.
Error HTTP Code Description
Push API Key not found 404 PNMM004 Master Key: <pushAPIKey> not found
Empty message 400 PNMM017 Message can�t be empty
Badge negative 400 PNMM062 Badge cannot be negative
No iOS certificate 400 PNMM082 iOS Push certificate is not set
No android API key 400 PNMM084 Android API key is not set
No iOS certificate password 400 PNMM085 iOS Push certificate password is not set




Method Summary
Options Name Purpose
# Destroy () /* Destroy/Shutdown/Anti-Initializer */
Inherited from OpenEdge.Mobile.PushNotificationService
# Initialize () /* Initializer/Startup */
Inherited from OpenEdge.Mobile.PushNotificationService
+ InitializeRegistry (BuilderRegistry) /** Adds initial values into the registry @param BuilderRegistry The registry to populate */
Inherited from OpenEdge.Mobile.PushNotificationService
# OpenEdge.Mobile.PushNotificationService Instance (character) /** Factory method for retrieving an instance of the server. @param character The (mandatory) API key to enable notifications */
Inherited from OpenEdge.Mobile.PushNotificationService
# OpenEdge.Mobile.PushNotificationService Instance (URI, character) /** Factory method for retrieving an instance of the server. @param URI A URI representing the notification server @param character The (mandatory) API key to enable notifications */
Inherited from OpenEdge.Mobile.PushNotificationService
ProcessResponse (IHttpResponse) /** Processes a response from the Notification service. Creates and throws a NotificationServiceError if necessary. @param HttpResponse The result of the REST request. @throws NotificationServiceError Throws an error if the return code is not 200 or 204 */
# ScheduleNotification (character, integer, datetime-tz, logical) /** Sends an immediate notification. Defaults to a no-filter query. @param character The message to be sent. @param integer The badge counter (only used for iOS). @param datetime-tz The time at which to send the notification @param logical Whether the notification should be sent at that time in a particular timezone, or at that time in the device's timezone. */
Inherited from OpenEdge.Mobile.PushNotificationService
# SendNotification (character, integer) /** Sends an immediate notification. Defaults to a no-filter query. @param character The message to be sent. @param integer The badge counter (only used for iOS). */
Inherited from OpenEdge.Mobile.PushNotificationService
# Progress.Json.ObjectModel.JsonConstruct SendNotification (JsonObject) /** Sends a notification for a given payload. The payload may be built by one of the methods in this class, or created by the PushNotificationMessageBuilder class (which is also used internally). This method performs the actual request to the Notification Service. @param JsonObject The notification payload. */
Overrides OpenEdge.Mobile.PushNotificationService:SendNotification (JsonObject)

Constructor Summary
Options Name Purpose
# ApperyPushNotificationService (character) /** Constructor. @param character The (mandatory) API key to enable notifications */
# ApperyPushNotificationService (URI, character) /** Constructor. @param URI A URI representing the notification server @param character The (mandatory) API key to enable notifications */

Property Summary
Options Name Purpose
# CHARACTER ApiKey /** (mandatory) The API key for the push notification */
Inherited from OpenEdge.Mobile.PushNotificationService
# BuilderRegistry Registry /** Registry for mapping build types to their implementations */
Inherited from OpenEdge.Mobile.PushNotificationService
# OpenEdge.Net.URI ServerUri /** (mandatory) The host/URI of the notification service */
Inherited from OpenEdge.Mobile.PushNotificationService


Method Detail
Top

PROTECTED Destroy ()

Inherited from OpenEdge.Mobile.PushNotificationService
/* Destroy/Shutdown/Anti-Initializer
Top

PROTECTED Initialize ()

Inherited from OpenEdge.Mobile.PushNotificationService
/* Initializer/Startup
Top

PUBLIC InitializeRegistry (BuilderRegistry)

Inherited from OpenEdge.Mobile.PushNotificationService
Purpose: Adds initial values into the registry
Parameters:
poRegistry BuilderRegistry
Top

PROTECTED OpenEdge.Mobile.PushNotificationService Instance (character)

Inherited from OpenEdge.Mobile.PushNotificationService
Purpose: Factory method for retrieving an instance of the server.
Parameters:
pcApiKey CHARACTER
Returns OpenEdge.Mobile.PushNotificationService
Top

PROTECTED OpenEdge.Mobile.PushNotificationService Instance (URI, character)

Inherited from OpenEdge.Mobile.PushNotificationService
Purpose: Factory method for retrieving an instance of the server.
Parameters:
poURI OpenEdge.Net.URI
pcApiKey CHARACTER
Returns OpenEdge.Mobile.PushNotificationService
Top

ProcessResponse (IHttpResponse)

Purpose: Processes a response from the Notification service. Creates and throws
a NotificationServiceError if necessary.
@throws NotificationServiceError Throws an error if the return code is
not 200 or 204
Parameters:
poResponse OpenEdge.Net.HTTP.IHttpResponse
Top

PROTECTED ScheduleNotification (character, integer, datetime-tz, logical)

Inherited from OpenEdge.Mobile.PushNotificationService
Purpose: Sends an immediate notification. Defaults to a no-filter query.
in a particular timezone, or at that time in the
device's timezone.
Parameters:
pcMessage CHARACTER
piBadge INTEGER
ptSendAt DATETIME-TZ
plUseDeviceTimeZone LOGICAL
Top

PROTECTED SendNotification (character, integer)

Inherited from OpenEdge.Mobile.PushNotificationService
Purpose: Sends an immediate notification. Defaults to a no-filter query.
Parameters:
pcMessage CHARACTER
piBadge INTEGER
Top

PROTECTED Progress.Json.ObjectModel.JsonConstruct SendNotification (JsonObject)

Overrides OpenEdge.Mobile.PushNotificationService:SendNotification (JsonObject)
Purpose: Sends a notification for a given payload. The payload may be built by one
of the methods in this class, or created by the PushNotificationMessageBuilder
class (which is also used internally).
This method performs the actual request to the Notification Service.
Parameters:
poPayload Progress.Json.ObjectModel.JsonObject
Returns Progress.Json.ObjectModel.JsonConstruct


Constructor Detail
Top

PROTECTED ApperyPushNotificationService (character)

Purpose: Constructor.
Parameters:
pcApiKey CHARACTER
Top

PROTECTED ApperyPushNotificationService (URI, character)

Purpose: Constructor.
Parameters:
poURI OpenEdge.Net.URI
pcApiKey CHARACTER


Property Detail
Top

PROTECTED CHARACTER ApiKey

Inherited from OpenEdge.Mobile.PushNotificationService
Purpose: (mandatory) The API key for the push notification
Returns CHARACTER
Top

PROTECTED BuilderRegistry Registry

Inherited from OpenEdge.Mobile.PushNotificationService
Purpose: Registry for mapping build types to their implementations
Returns BuilderRegistry
Top

PROTECTED OpenEdge.Net.URI ServerUri

Inherited from OpenEdge.Mobile.PushNotificationService
Purpose: (mandatory) The host/URI of the notification service
Returns OpenEdge.Net.URI


10.27.2015 12:36:31