Class NotificationServices
Provides cross-platform interface for scheduling, registering and handling notifications.
Inheritance
Inherited Members
Namespace: VoxelBusters.EssentialKit
Assembly: cs.temp.dll.dll
Syntax
public static class NotificationServices
Properties
CachedSettings
Declaration
public static NotificationSettings CachedSettings { get; }
Property Value
| Type | Description |
|---|---|
| NotificationSettings |
ScheduledNotifications
Returns the cached scheduled notification array.
Declaration
public static INotification[] ScheduledNotifications { get; }
Property Value
| Type | Description |
|---|---|
| INotification[] |
Remarks
\note This property is invalid until a call to GetScheduledNotifications(EventCallback<NotificationServicesGetScheduledNotificationsResult>) is completed.
UnitySettings
Declaration
public static NotificationServicesUnitySettings UnitySettings { get; }
Property Value
| Type | Description |
|---|---|
| NotificationServicesUnitySettings |
Methods
CancelAllScheduledNotifications()
Unschedules all pending notification requests.
Declaration
public static void CancelAllScheduledNotifications()
CancelScheduledNotification(String)
Unschedules the specified notification.
Declaration
public static void CancelScheduledNotification(string notificationId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | notificationId | Notification id. |
CancelScheduledNotification(INotification)
Unschedules the specified notification.
Declaration
public static void CancelScheduledNotification(INotification notification)
Parameters
| Type | Name | Description |
|---|---|---|
| INotification | notification | Notification. |
CreateNotificationWithId(String)
Creates a new instance of local notification.
Declaration
public static NotificationBuilder CreateNotificationWithId(string notificationId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | notificationId | Notification identifier. |
Returns
| Type | Description |
|---|---|
| NotificationBuilder | The notification. |
GetDeliveredNotifications(EventCallback<NotificationServicesGetDeliveredNotificationsResult>)
Returns a list of the app’s notifications that are still displayed in Notification Center.
Declaration
public static void GetDeliveredNotifications(EventCallback<NotificationServicesGetDeliveredNotificationsResult> callback = null)
Parameters
| Type | Name | Description |
|---|---|---|
| EventCallback<NotificationServicesGetDeliveredNotificationsResult> | callback | Callback method that will be invoked after operation is completed. |
GetScheduledNotifications(EventCallback<NotificationServicesGetScheduledNotificationsResult>)
Returns a list of all notification requests that are scheduled and waiting to be delivered.
Declaration
public static void GetScheduledNotifications(EventCallback<NotificationServicesGetScheduledNotificationsResult> callback = null)
Parameters
| Type | Name | Description |
|---|---|---|
| EventCallback<NotificationServicesGetScheduledNotificationsResult> | callback | Callback method that will be invoked after operation is completed. |
GetSettings(Callback<NotificationServicesGetSettingsResult>)
Gets the notification settings available for this application.
Declaration
public static void GetSettings(Callback<NotificationServicesGetSettingsResult> callback = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Callback<NotificationServicesGetSettingsResult> | callback | Callback method that will be invoked after operation is completed. |
IsAuthorized()
Declaration
public static bool IsAuthorized()
Returns
| Type | Description |
|---|---|
| System.Boolean |
IsAuthorizedPermissionStatus(NotificationPermissionStatus)
Declaration
public static bool IsAuthorizedPermissionStatus(NotificationPermissionStatus accessStatus)
Parameters
| Type | Name | Description |
|---|---|---|
| NotificationPermissionStatus | accessStatus |
Returns
| Type | Description |
|---|---|
| System.Boolean |
IsAvailable()
Declaration
public static bool IsAvailable()
Returns
| Type | Description |
|---|---|
| System.Boolean |
IsInitializedAndAuthorized()
Declaration
public static bool? IsInitializedAndAuthorized()
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Boolean> |
IsPermissionAvailable()
Declaration
public static bool IsPermissionAvailable()
Returns
| Type | Description |
|---|---|
| System.Boolean |
IsRegisteredForPushNotifications()
Returns the registeration status for remote notifications.
Declaration
public static bool IsRegisteredForPushNotifications()
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
RegisterForPushNotifications(EventCallback<NotificationServicesRegisterForPushNotificationsResult>)
Registers to receive remote notifications via Push Notification service.
Declaration
public static void RegisterForPushNotifications(EventCallback<NotificationServicesRegisterForPushNotificationsResult> callback = null)
Parameters
| Type | Name | Description |
|---|---|---|
| EventCallback<NotificationServicesRegisterForPushNotificationsResult> | callback | Callback method that will be invoked after operation is completed. |
Remarks
\note If you want your app’s remote notifications to display alerts, play sounds etc you must call the RequestPermission(NotificationPermissionOptions, Boolean, EventCallback<NotificationServicesRequestPermissionResult>) method before registering for remote notifications.
RemoveAllDeliveredNotifications()
Removes all of the app’s delivered notifications from Notification Center.
Declaration
public static void RemoveAllDeliveredNotifications()
RequestPermission(NotificationPermissionOptions, Boolean, EventCallback<NotificationServicesRequestPermissionResult>)
Requests for permission to interact with the user when local and remote notifications are delivered to the user's device.
Declaration
public static void RequestPermission(NotificationPermissionOptions options, bool showPrepermissionDialog = true, EventCallback<NotificationServicesRequestPermissionResult> callback = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NotificationPermissionOptions | options | The authorization options your app is requesting. You may combine the available constants to request authorization for multiple items. |
| System.Boolean | showPrepermissionDialog | Indicates whether pre-confirmation is required, before prompting system permission dialog. |
| EventCallback<NotificationServicesRequestPermissionResult> | callback | Callback method that will be invoked after operation is completed. |
ScheduleNotification(INotification, CompletionCallback)
Schedules a local notification for delivery.
Declaration
public static void ScheduleNotification(INotification notification, CompletionCallback callback = null)
Parameters
| Type | Name | Description |
|---|---|---|
| INotification | notification | Notification. |
| CompletionCallback | callback | Callback method that will be invoked after operation is completed. |
TryRegisterForPushNotifications()
Declaration
public static void TryRegisterForPushNotifications()
UnregisterForPushNotifications()
Unregister for all remote notifications received via Push Notification service.
Declaration
public static void UnregisterForPushNotifications()
Remarks
\note Apps unregistered through this method can always re-register.
Events
OnNotificationReceived
Declaration
public static event Callback<NotificationServicesNotificationReceivedResult> OnNotificationReceived
Event Type
| Type | Description |
|---|---|
| Callback<NotificationServicesNotificationReceivedResult> |
OnRegisterForPushNotificationsComplete
Declaration
public static event EventCallback<NotificationServicesRegisterForPushNotificationsResult> OnRegisterForPushNotificationsComplete
Event Type
| Type | Description |
|---|---|
| EventCallback<NotificationServicesRegisterForPushNotificationsResult> |
OnSettingsUpdate
Declaration
public static event Callback<NotificationSettings> OnSettingsUpdate
Event Type
| Type | Description |
|---|---|
| Callback<NotificationSettings> |