Class iOSNotificationCenter
Use the iOSNotificationCenter to register notification channels and schedule local notifications.
Inherited Members
Namespace: Unity.Notifications.iOS
Assembly: solution.dll
Syntax
public class iOSNotificationCenter
Properties
| Name | Description |
|---|---|
| ApplicationBadge | The number currently set as the badge of the app icon. |
Methods
| Name | Description |
|---|---|
| GetDeliveredNotifications() | Returns all of the app's delivered notifications that are currently shown in the Notification Center. |
| GetLastRespondedNotification() | Use this to retrieve the last local or remote notification received by the app. Do not call this in Awake or Start of the first scene, wait for at least a frame. On cold app start iOS reports this with small delay. |
| GetLastRespondedNotificationAction() | Get users chosen action for the last actionable notification, null if no action was chosen. |
| GetLastRespondedNotificationUserText() | Get users text input for the last actionable notification with input support, null if no input. |
| GetNotificationSettings() | Get the notification settings for this app. |
| GetScheduledNotifications() | Returns all notifications that are currently scheduled. |
| OpenNotificationSettings() | Opens Settings. On iOS there is no way to open notification settings specifically, but you can open settings app with current application settings. Note, that application will be suspended, since opening settings is switching to different application. |
| RemoveAllDeliveredNotifications() | Removes all of the app's delivered notifications from the Notification Center. |
| RemoveAllScheduledNotifications() | Unschedules all pending notification. |
| RemoveDeliveredNotification(string) | Removes the specified notification from Notification Center. |
| RemoveScheduledNotification(string) | Unschedules the specified notification. |
| ScheduleNotification(iOSNotification) | Schedules a local notification for delivery. |
| SetNotificationCategories(IEnumerable<iOSNotificationCategory>) | Set (replace if already set) notification categories. Use this to setup actionable notifications. You can specify actions for each category, which then will be available for each notification with the same category identifier. Categories must be registered before sending notifications. |
Events
| Name | Description |
|---|---|
| OnNotificationReceived | Subscribe to this event to receive a callback whenever a local notification or a remote is shown to the user. |
| OnRemoteNotificationReceived | Subscribe to this event to receive a callback whenever a remote notification is received while the app is in foreground, if you subscribe to this event remote notification will not be shown while the app is in foreground and if you still want to show it to the user you will have to schedule a local notification with the data received from this callback. If you want remote notifications to be shown automatically subscribe to the [[OnNotificationReceived]] even instead and check the [[Notification.Trigger]] class type to determine whether the received notification is a remote notification. |