docs.unity3d.com
    Show / Hide Table of Contents

    Struct GameNotificationChannel

    Cross-platform wrapper to represent channels for notifications.

    Namespace: NotificationSamples
    Syntax
    public struct GameNotificationChannel
    Remarks

    On Android, this maps pretty closely to Android Notification Channels. On iOS, this does nothing.

    For projects targeting Android, you need to have at least one channel.

    Constructors

    GameNotificationChannel(String, String, String)

    Initialize a new instance of GameNotificationChannel with optional fields set to their default values.

    Declaration
    public GameNotificationChannel(string id, string name, string description)
    Parameters
    Type Name Description
    String id
    String name
    String description

    GameNotificationChannel(String, String, String, GameNotificationChannel.NotificationStyle, Boolean, Boolean, Boolean, Boolean, GameNotificationChannel.PrivacyMode, Int64[])

    Initialize a new instance of GameNotificationChannel, providing the notification style and optionally all other settings.

    Declaration
    public GameNotificationChannel(string id, string name, string description, GameNotificationChannel.NotificationStyle style, bool showsBadge = true, bool showLights = false, bool vibrates = true, bool highPriority = false, GameNotificationChannel.PrivacyMode privacy = GameNotificationChannel.PrivacyMode.Public, long[] vibrationPattern = null)
    Parameters
    Type Name Description
    String id
    String name
    String description
    GameNotificationChannel.NotificationStyle style
    Boolean showsBadge
    Boolean showLights
    Boolean vibrates
    Boolean highPriority
    GameNotificationChannel.PrivacyMode privacy
    Int64[] vibrationPattern

    Fields

    Description

    The description of the channel as displayed to the user.

    Declaration
    public readonly string Description
    Field Value
    Type Description
    String

    HighPriority

    A flag determining whether messages on this channel bypass do not disturb settings. Defaults to false.

    Declaration
    public readonly bool HighPriority
    Field Value
    Type Description
    Boolean

    Id

    The identifier for the channel.

    Declaration
    public readonly string Id
    Field Value
    Type Description
    String

    Name

    The name of the channel as displayed to the user.

    Declaration
    public readonly string Name
    Field Value
    Type Description
    String

    Privacy

    The privacy setting for this notification. Defaults to Public.

    Declaration
    public readonly GameNotificationChannel.PrivacyMode Privacy
    Field Value
    Type Description
    GameNotificationChannel.PrivacyMode

    ShowLights

    A flag determining whether messages on this channel cause the device light to flash. Defaults to false.

    Declaration
    public readonly bool ShowLights
    Field Value
    Type Description
    Boolean

    ShowsBadge

    A flag determining whether messages on this channel can show a badge. Defaults to true.

    Declaration
    public readonly bool ShowsBadge
    Field Value
    Type Description
    Boolean

    Style

    The display style for this notification. Defaults to Popup.

    Declaration
    public readonly GameNotificationChannel.NotificationStyle Style
    Field Value
    Type Description
    GameNotificationChannel.NotificationStyle

    Vibrates

    A flag determining whether messages on this channel cause the device to vibrate. Defaults to true.

    Declaration
    public readonly bool Vibrates
    Field Value
    Type Description
    Boolean

    VibrationPattern

    The custom vibration pattern for this channel. Set to null to use the default.

    Declaration
    public readonly int[] VibrationPattern
    Field Value
    Type Description
    Int32[]
    In This Article
    • Constructors
      • GameNotificationChannel(String, String, String)
      • GameNotificationChannel(String, String, String, GameNotificationChannel.NotificationStyle, Boolean, Boolean, Boolean, Boolean, GameNotificationChannel.PrivacyMode, Int64[])
    • Fields
      • Description
      • HighPriority
      • Id
      • Name
      • Privacy
      • ShowLights
      • ShowsBadge
      • Style
      • Vibrates
      • VibrationPattern
    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