Notification SDK Server  4.31.0
The Notification SDK Server provides a library to send notification to various devices (iOS and Android)
NotificationSDKServer Class Reference

Public Member Functions

 NotificationSDKServer (NotificationSDKServerCredentials credentials)
 
 NotificationSDKServer (NotificationSDKServerCredentials credentials, NotificationSDKServerSettings settings)
 
void SendNotification (string vascoNotificationIdentifier, Notification notification)
 
void AwaitSendTerminationAndFinish ()
 
Dictionary< string, DateTime > GetIOSInactiveDevices ()
 

Static Public Member Functions

static NotificationSDKServerPlatformNames GetPlatformName (string vascoNotificationIdentifier)
 
static int GetPayloadLength (Notification notification, NotificationSDKServerPlatformNames platformName)
 

Static Public Attributes

const string VERSION = "4.31.0"
 
const int MAX_PAYLOAD_LENGTH_ANDROID = 4096
 
const int MAX_PAYLOAD_LENGTH_IOS = 2048
 

Events

SendNotificationErrorDelegate OnSendNotificationError
 
SendNotificationSuccessDelegate OnSendNotificationSuccess
 

Detailed Description

Provides the entry points for the NotificationSDKServer library:


Version
4.31.0

Constructor & Destructor Documentation

◆ NotificationSDKServer() [1/2]

Constructs a NotificationSDKServer object.

Parameters
credentialsThe NotificationSDKServerCredentials necessary to log in to the platform specific push notification services.

◆ NotificationSDKServer() [2/2]

Constructs a NotificationSDKServer object with the credentials in input.

Parameters
credentialsThe NotificationSDKServerCredentials necessary to log in to the platform specific push notification services.
settingsThe NotificationSDKServerSettings necessary to tune server specific settings. Can be null.
Exceptions
NotificationSDKServerExceptionException containing an error code and a message. Available error codes are:

Member Function Documentation

◆ AwaitSendTerminationAndFinish()

void AwaitSendTerminationAndFinish ( )
inline

Wait for all submitted notifications to be sent.
The last notifications that have not been sent after a specific timeout (which is specified in the NotificationSDKServerSettings object of the NotificationSDKServer object) will be cancelled.
All connections are closed. The object is not usable anymore and thus can't be used to send notifications.

Exceptions
NotificationSDKServerExceptionException containing an error code and a message. Available error codes are:

◆ GetIOSInactiveDevices()

Dictionary<string, DateTime> GetIOSInactiveDevices ( )
inline

Returns the list of devices that reported failed-delivery attempts to the Apple Feedback services. The result is a map, containing the notification identifier mapped to the timestamp when APNs determined that the application no longer exists on the device.

Returns
The map containing a notification identifier and a timestamp
Exceptions
NotificationSDKServerExceptionException containing an error code and a message. Available error codes are:

◆ GetPayloadLength()

static int GetPayloadLength ( Notification  notification,
NotificationSDKServerPlatformNames  platformName 
)
inlinestatic

Gets the notification payload length, in bytes, depending on the given platform name. For all platforms, the payload is encoded in UTF-8 before its length calculation. Therefore, a non-latin character (Cyrillic, Japanese, Arabic, etc.) will have a length greater than 1.
Please note that each protocol adds some overhead. The usable length is thus smaller than the theoretical maximum payload length.

Parameters
notificationNotification containing a title, subject...
platformNameThe platform name.
Returns
The notification payload length in bytes.
Exceptions
NotificationSDKServerExceptionException containing an error code and a message. Available error codes are:

◆ GetPlatformName()

static NotificationSDKServerPlatformNames GetPlatformName ( string  vascoNotificationIdentifier)
inlinestatic

Gets the platform name from a VASCONotificationIdentifier identified by its hexadecimal representation.

Parameters
vascoNotificationIdentifierHexadecimal representation of the VASCO notification identifier.
Returns
the platform name of VASCO Notification Identifier (see NotificationSDKServerPlatformNames).
Exceptions
NotificationSDKServerExceptionException containing an error code and a message. Available error codes are:

◆ SendNotification()

void SendNotification ( string  vascoNotificationIdentifier,
Notification  notification 
)
inline

Sends a notification, described by a Notification object, using the specified client device identifier.
As the process of sending a notification is asynchronous, a callback is necessary in order to handle errors or to report success.

Parameters
vascoNotificationIdentifierThe VASCO Notification Identifier provided by the client. String, cannot be null or empty.
notificationNotification that must be sent to the device (check Notification).
Exceptions
NotificationSDKServerExceptionException containing an error code and a message. Available error codes are:

Field Documentation

◆ MAX_PAYLOAD_LENGTH_ANDROID

const int MAX_PAYLOAD_LENGTH_ANDROID = 4096
static

Maximum length, in bytes, of the notification payload for Android as described by the Google Cloud Messaging (GCM) specifications.

◆ MAX_PAYLOAD_LENGTH_IOS

const int MAX_PAYLOAD_LENGTH_IOS = 2048
static

Maximum length, in bytes, of the notification payload for iOS as described by the Apple Push Notification Service (APNS) specifications.

◆ VERSION

const string VERSION = "4.31.0"
static

NotificationSDKServer library version

Event Documentation

◆ OnSendNotificationError

SendNotificationErrorDelegate OnSendNotificationError

Callback implementing SendNotificationErrorDelegate, and called in case of error while sending a notification.

◆ OnSendNotificationSuccess

SendNotificationSuccessDelegate OnSendNotificationSuccess

Callback implementing SendNotificationSuccessDelegate, and called in case of success while sending a notification.


The documentation for this class was generated from the following file: