Interface IGameNotificationsPlatform
Any type that handles notifications for a specific game platform
Namespace: NotificationSamples
Syntax
public interface IGameNotificationsPlatform
Methods
CancelAllScheduledNotifications()
Cancels all scheduled notifications.
Declaration
void CancelAllScheduledNotifications()
CancelNotification(Int32)
Cancels a scheduled notification.
Declaration
void CancelNotification(int notificationId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | notificationId | The ID of a previously scheduled notification. |
CreateNotification()
Create a new instance of a IGameNotification for this platform.
Declaration
IGameNotification CreateNotification()
Returns
Type | Description |
---|---|
IGameNotification | A new platform-appropriate notification object. |
DismissAllDisplayedNotifications()
Dismisses all displayed notifications.
Declaration
void DismissAllDisplayedNotifications()
DismissNotification(Int32)
Dismiss a displayed notification.
Declaration
void DismissNotification(int notificationId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | notificationId | The ID of a previously scheduled notification that is being displayed to the user. |
GetLastNotification()
Use this to retrieve the last local or remote notification received by the app.
Declaration
IGameNotification GetLastNotification()
Returns
Type | Description |
---|---|
IGameNotification | Returns the last local or remote notification used to open the app or clicked on by the user. If no notification is available it returns null. |
Remarks
On Android the last notification is not cleared until the application is explicitly quit.
OnBackground()
Performs any processing necessary on backgrounding or closing the application.
Declaration
void OnBackground()
OnForeground()
Performs any initialization or processing necessary on foregrounding the application.
Declaration
void OnForeground()
ScheduleNotification(IGameNotification)
Schedules a notification to be delivered.
Declaration
void ScheduleNotification(IGameNotification gameNotification)
Parameters
Type | Name | Description |
---|---|---|
IGameNotification | gameNotification | The notification to deliver. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException |
|
Events
NotificationReceived
Fired when a notification is received.
Declaration
event Action<IGameNotification> NotificationReceived
Event Type
Type | Description |
---|---|
Action<IGameNotification> |