Essential Kit
Loading...
Searching...
No Matches
NotificationServices

Provides cross-platform interface for scheduling, registering and handling notifications.

Static Public Member Functions

static void RequestPermission (NotificationPermissionOptions options, bool showPrepermissionDialog=true, EventCallback< NotificationServicesRequestPermissionResult > callback=null)
 Requests for permission to interact with the user when local and remote notifications are delivered to the user's device.
 
static void GetSettings (Callback< NotificationServicesGetSettingsResult > callback=null)
 Gets the notification settings available for this application.
 
static NotificationBuilder CreateNotificationWithId (string notificationId)
 Creates a new instance of local notification.
 
static void ScheduleNotification (INotification notification, CompletionCallback callback=null)
 Schedules a local notification for delivery.
 
static void GetScheduledNotifications (EventCallback< NotificationServicesGetScheduledNotificationsResult > callback=null)
 Returns a list of all notification requests that are scheduled and waiting to be delivered.
 
static void CancelScheduledNotification (string notificationId)
 Unschedules the specified notification.
 
static void CancelScheduledNotification (INotification notification)
 Unschedules the specified notification.
 
static void CancelAllScheduledNotifications ()
 Unschedules all pending notification requests.
 
static void GetDeliveredNotifications (EventCallback< NotificationServicesGetDeliveredNotificationsResult > callback=null)
 Returns a list of the app’s notifications that are still displayed in Notification Center.
 
static void RemoveAllDeliveredNotifications ()
 Removes all of the app’s delivered notifications from Notification Center.
 
static void RegisterForPushNotifications (EventCallback< NotificationServicesRegisterForPushNotificationsResult > callback=null)
 Registers to receive remote notifications via Push Notification service.
 
static void UnregisterForPushNotifications ()
 Unregister for all remote notifications received via Push Notification service.
 
static bool IsRegisteredForPushNotifications ()
 Returns the registeration status for remote notifications.
 
static void SetApplicationIconBadgeNumber (int count)
 Set application icon badge number.
 
Advanced Usage
static void Initialize (NotificationServicesUnitySettings settings)
 Initializes the notification services module with the given settings. This call is optional and only need to be called if you have custom settings to initialize this feature.
 

Properties

static INotification[] ScheduledNotifications [get]
 Returns the cached scheduled notification array.
 

Member Function Documentation

◆ RequestPermission()

static void RequestPermission ( NotificationPermissionOptions options,
bool showPrepermissionDialog = true,
EventCallback< NotificationServicesRequestPermissionResult > callback = null )
static
Parameters
optionsThe authorization options your app is requesting. You may combine the available constants to request authorization for multiple items.
showPrepermissionDialogIndicates whether pre-confirmation is required, before prompting system permission dialog.
callbackCallback method that will be invoked after operation is completed.

◆ GetSettings()

static void GetSettings ( Callback< NotificationServicesGetSettingsResult > callback = null)
static
Parameters
callbackCallback method that will be invoked after operation is completed.

◆ CreateNotificationWithId()

static NotificationBuilder CreateNotificationWithId ( string notificationId)
static
Returns
The notification.
Parameters
notificationIdNotification identifier.

References NotificationBuilder.CreateNotification().

◆ ScheduleNotification()

static void ScheduleNotification ( INotification notification,
CompletionCallback callback = null )
static
Parameters
notificationNotification.
callbackCallback method that will be invoked after operation is completed.

◆ GetScheduledNotifications()

static void GetScheduledNotifications ( EventCallback< NotificationServicesGetScheduledNotificationsResult > callback = null)
static
Parameters
callbackCallback method that will be invoked after operation is completed.

References NotificationServices.ScheduledNotifications.

◆ CancelScheduledNotification() [1/2]

static void CancelScheduledNotification ( string notificationId)
static
Parameters
notificationIdNotification id.

◆ CancelScheduledNotification() [2/2]

static void CancelScheduledNotification ( INotification notification)
static
Parameters
notificationNotification.

References INotification.Id.

◆ GetDeliveredNotifications()

static void GetDeliveredNotifications ( EventCallback< NotificationServicesGetDeliveredNotificationsResult > callback = null)
static
Parameters
callbackCallback method that will be invoked after operation is completed.

◆ RegisterForPushNotifications()

static void RegisterForPushNotifications ( EventCallback< NotificationServicesRegisterForPushNotificationsResult > callback = null)
static

Call this method to initiate the registration process with Push Notification service. When registration process completes, callback is fired. If registration succeeds, then you should pass device token to the server you use to generate remote notifications.

Note
If you want your app’s remote notifications to display alerts, play sounds etc you must call the RequestPermission(NotificationPermissionOptions, bool, EventCallback<NotificationServicesRequestPermissionResult>) method before registering for remote notifications.
Parameters
callbackCallback method that will be invoked after operation is completed.

◆ UnregisterForPushNotifications()

static void UnregisterForPushNotifications ( )
static
Note
Apps unregistered through this method can always re-register.

◆ IsRegisteredForPushNotifications()

static bool IsRegisteredForPushNotifications ( )
static
Returns
true, if registered for remote notifications, false otherwise.

◆ SetApplicationIconBadgeNumber()

static void SetApplicationIconBadgeNumber ( int count)
static
Note
When set to 0, the application badge will be cleared from the icon.

Property Documentation

◆ ScheduledNotifications