docs.unity3d.com
    Show / Hide Table of Contents

    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

    gameNotification is null.

    InvalidOperationException

    gameNotification isn't of the correct type.

    Events

    NotificationReceived

    Fired when a notification is received.

    Declaration
    event Action<IGameNotification> NotificationReceived
    Event Type
    Type Description
    Action<IGameNotification>
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023