Struct AndroidNotificationChannel | Mobile Notifications | 1.0.4-preview.9
docs.unity3d.com
    Show / Hide Table of Contents

    Struct AndroidNotificationChannel

    Namespace: Unity.Notifications.Android
    Syntax
    public struct AndroidNotificationChannel

    Constructors

    AndroidNotificationChannel(String, String, String, Importance)

    Create a notification channel struct with all optional fields set to default values.

    Declaration
    public AndroidNotificationChannel(string id, string title, string description, Importance importance)
    Parameters
    Type Name Description
    String id
    String title
    String description
    Importance importance

    Properties

    CanBypassDnd

    Whether or not notifications posted to this channel can bypass the Do Not Disturb. This can be changed by users in the settings app.

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

    CanShowBadge

    Whether notifications posted to this channel can appear as badges in a Launcher application.

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

    Description

    User visible description of the notification channel.

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

    Enabled

    Returns false if the user has blocked this notification in the settings app. Channels can be manually blocked by settings it's Importance to None.

    Declaration
    public bool Enabled { get; }
    Property Value
    Type Description
    Boolean

    EnableLights

    Sets whether notifications posted to this channel should display notification lights, on devices that support that feature. This can be changed by users in the settings app.

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

    EnableVibration

    Sets whether notification posted to this channel should vibrate. This can be changed by users in the settings app.

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

    Id

    Notification channel identifier. Must be specified when scheduling notifications.

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

    Importance

    Importance level which is applied to all notifications sent to the channel. This can be changed by users in the settings app. Android uses importance to determine how much the notification should interrupt the user (visually and audibly). The higher the importance of a notification, the more interruptive the notification will be. The possible importance levels are the following: High: Makes a sound and appears as a heads-up notification. Default: Makes a sound. Low: No sound. None: No sound and does not appear in the status bar.

    Declaration
    public Importance Importance { get; set; }
    Property Value
    Type Description
    Importance

    LockScreenVisibility

    Sets whether or not notifications posted to this channel are shown on the lockscreen in full or redacted form. This can be changed by users in the settings app.

    Declaration
    public LockScreenVisibility LockScreenVisibility { get; set; }
    Property Value
    Type Description
    LockScreenVisibility

    Name

    Notification channel name which is visible to users.

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

    VibrationPattern

    Sets the vibration pattern for notifications posted to this channel.

    Declaration
    public long[] VibrationPattern { get; set; }
    Property Value
    Type Description
    Int64[]
    In This Article
    • Constructors
      • AndroidNotificationChannel(String, String, String, Importance)
    • Properties
      • CanBypassDnd
      • CanShowBadge
      • Description
      • Enabled
      • EnableLights
      • EnableVibration
      • Id
      • Importance
      • LockScreenVisibility
      • Name
      • VibrationPattern
    Back to top
    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