Interface UM_iNotificationsClient
Cross-platform notifications client.
Namespace: SA.CrossPlatform.Notifications
Assembly: cs.temp.dll.dll
Syntax
public interface UM_iNotificationsClient
Properties
LastOpenedNotification
Contains last received UM_NotificationRequest object by delegate.
You must subscribe to this class events as soon as possible. However, delegate may already receive action while app was launching. For example if user has launched the app by clicking on notifications. You may check LastOpenedNotification to find out of app was launched using the notification. If Property is null after your app is launched it means that application was launched without interaction with the notification object.
Declaration
UM_NotificationRequest LastOpenedNotification { get; }
Property Value
Type | Description |
---|---|
UM_NotificationRequest |
OnNotificationClick
Called when user is clicked on notification while your application was in background. The notification will be delivered as soon as app enters foreground.
Declaration
SA_iEvent<UM_NotificationRequest> OnNotificationClick { get; }
Property Value
Type | Description |
---|---|
SA_iEvent<UM_NotificationRequest> |
OnNotificationReceived
Called when a notification is delivered to a foreground app.
If your app is in the foreground when a notification arrives, the notification center calls this method to deliver the notification directly to your app. If you implement this method, you can take whatever actions are necessary to process the notification and update your app. User will not be alerted by a system;
Declaration
SA_iEvent<UM_NotificationRequest> OnNotificationReceived { get; }
Property Value
Type | Description |
---|---|
SA_iEvent<UM_NotificationRequest> |
Methods
AddNotificationRequest(UM_NotificationRequest, Action<SA_Result>)
Schedules a local notification for delivery.
This method schedules local notifications only; You cannot use it to schedule the delivery of push notifications. The notification is delivered when the trigger condition in the request parameter is met. If the request does not contain a UM_iNotificationTrigger object, the notification is delivered right away.
You may call this method from any thread of your app.
Declaration
void AddNotificationRequest(UM_NotificationRequest request, Action<SA_Result> callback)
Parameters
Type | Name | Description |
---|---|---|
UM_NotificationRequest | request | The notification request to schedule.This parameter must not be |
Action<SA_Result> | callback | The block to execute with the results. |
RemoveAllDeliveredNotifications()
Removes all of the app’s notifications from Notification Center.
Use this method to remove all of your app’s notifications from Notification Center. The method executes asynchronously, returning immediately and removing the identifiers on a background thread.
Declaration
void RemoveAllDeliveredNotifications()
RemoveAllPendingNotifications()
Unscheduled all pending notification requests. This method executes asynchronously, removing all pending notification requests on a secondary thread.
Declaration
void RemoveAllPendingNotifications()
RemoveDeliveredNotification(Int32)
Removes the specified notifications from Notification Center.
Use this method to selectively remove notifications that you no longer want displayed in Notification Center. The method executes asynchronously, returning immediately and removing the identifiers on a background thread.
Declaration
void RemoveDeliveredNotification(int identifier)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | identifier | The identifier associated with a notification request object.
This method ignores the |
RemovePendingNotification(Int32)
Unscheduled the specified notification requests. This method executes asynchronously, removing the pending notification requests on a secondary thread.
Declaration
void RemovePendingNotification(int identifier)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | identifier | Thee Identifier of notification requests you want to remove. If the identifier belongs to a non repeating request whose notification has already been delivered, this method ignores the identifier. |
RequestAuthorization(Action<SA_Result>)
Unscheduled all pending notification requests. This method executes asynchronously, removing all pending notification requests on a secondary thread.
Declaration
void RequestAuthorization(Action<SA_Result> callback)
Parameters
Type | Name | Description |
---|---|---|
Action<SA_Result> | callback |