using System;
using System.Collections;
namespace NotificationSamples
{
///
/// Any type that handles notifications for a specific game platform
///
public interface IGameNotificationsPlatform
{
///
/// Fired when a notification is received.
///
event Action NotificationReceived;
IEnumerator RequestNotificationPermission();
///
/// Create a new instance of a for this platform.
///
/// A new platform-appropriate notification object.
IGameNotification CreateNotification();
///
/// Schedules a notification to be delivered.
///
/// The notification to deliver.
/// is null.
/// isn't of the correct type.
void ScheduleNotification(IGameNotification gameNotification);
///
/// Cancels a scheduled notification.
///
/// The ID of a previously scheduled notification.
void CancelNotification(int notificationId);
///
/// Dismiss a displayed notification.
///
/// The ID of a previously scheduled notification that is being displayed to the user.
void DismissNotification(int notificationId);
///
/// Cancels all scheduled notifications.
///
void CancelAllScheduledNotifications();
///
/// Dismisses all displayed notifications.
///
void DismissAllDisplayedNotifications();
///
/// Use this to retrieve the last local or remote notification received by the app.
///
///
/// On Android the last notification is not cleared until the application is explicitly quit.
///
///
/// 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.
///
IGameNotification GetLastNotification();
///
/// Performs any initialization or processing necessary on foregrounding the application.
///
void OnForeground();
///
/// Performs any processing necessary on backgrounding or closing the application.
///
void OnBackground();
}
///
/// Any type that handles notifications for a specific game platform.
///
/// Has a concrete notification type
/// The type of notification returned by this platform.
public interface IGameNotificationsPlatform : IGameNotificationsPlatform
where TNotificationType : IGameNotification
{
///
/// Create an instance of .
///
/// A new platform-appropriate notification object.
new TNotificationType CreateNotification();
///
/// Schedule a notification to be delivered.
///
/// The notification to deliver.
/// is null.
void ScheduleNotification(TNotificationType notification);
///
/// Use this to retrieve the last local or remote notification of
/// received by the app.
///
///
/// On Android the last notification is not cleared until the application is explicitly quit.
///
///
/// Returns new platform-appropriate notification object for 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.
///
new TNotificationType GetLastNotification();
}
}