docs.unity3d.com
    Show / Hide Table of Contents

    Class NotificationSettings.AndroidSettings

    Class used to access Android-specific notification settings.

    Inheritance
    Object
    NotificationSettings.AndroidSettings
    Namespace: Unity.Notifications
    Syntax
    public static class AndroidSettings

    Properties

    CustomActivityString

    The full class name of the activity that you wish to be assigned to the notification.

    Declaration
    public static string CustomActivityString { get; set; }
    Property Value
    Type Description
    String

    RescheduleOnDeviceRestart

    By default AndroidSettings removes all scheduled notifications when the device is restarted. Enable this to automatically reschedule all non expired notifications when the device is turned back on.

    Declaration
    public static bool RescheduleOnDeviceRestart { get; set; }
    Property Value
    Type Description
    Boolean

    UseCustomActivity

    Enable this if you want to override the activity which will opened when the user click on the notification. By default activity assigned to com.unity3d.player.UnityPlayer.currentActivity will be used.

    Declaration
    public static bool UseCustomActivity { get; set; }
    Property Value
    Type Description
    Boolean

    Methods

    AddDrawableResource(String, Texture2D, NotificationIconType)

    Add image to notification settings.

    Declaration
    public static void AddDrawableResource(string id, Texture2D image, NotificationIconType type)
    Parameters
    Type Name Description
    String id

    Image identifier

    Texture2D image

    Image texture, must be obtained from asset database

    NotificationIconType type

    Image type

    ClearDrawableResources()

    Remove all images from notification settings.

    Declaration
    public static void ClearDrawableResources()

    RemoveDrawableResource(Int32)

    Remove icon at given index from notification settings.

    Declaration
    public static void RemoveDrawableResource(int index)
    Parameters
    Type Name Description
    Int32 index

    Index of image to remove

    RemoveDrawableResource(String)

    Remove icon with given identifier from notification settings.

    Declaration
    public static void RemoveDrawableResource(string id)
    Parameters
    Type Name Description
    String id

    ID of the image to remove

    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