NotificationChannel Class

Definition

A representation of settings that apply to a collection of similarly themed notifications.

[Android.Runtime.Register("android/app/NotificationChannel", ApiSince=26, DoNotGenerateAcw=true)]
public sealed class NotificationChannel : Java.Lang.Object, Android.OS.IParcelable, IDisposable
[<Android.Runtime.Register("android/app/NotificationChannel", ApiSince=26, DoNotGenerateAcw=true)>]
type NotificationChannel = class
    inherit Object
    interface IParcelable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
NotificationChannel
Attributes
Implements

Remarks

A representation of settings that apply to a collection of similarly themed notifications.

Android reference for android.app.NotificationChannel.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Name Description
NotificationChannel(String, ICharSequence, NotificationImportance)

Creates a notification channel.

NotificationChannel(String, String, NotificationImportance)

Creates a notification channel.

Fields

Name Description
DefaultChannelId

The id of the default channel for an app.

EditConversation

Extra value for Settings.EXTRA_CHANNEL_FILTER_LIST.

EditImportance

Extra value for Settings.EXTRA_CHANNEL_FILTER_LIST.

EditLauncher

Extra value for Settings.EXTRA_CHANNEL_FILTER_LIST.

EditLockedDevice

Extra value for Settings.EXTRA_CHANNEL_FILTER_LIST.

EditSound

Extra value for Settings.EXTRA_CHANNEL_FILTER_LIST.

EditVibration

Extra value for Settings.EXTRA_CHANNEL_FILTER_LIST.

EditZen

Extra value for Settings.EXTRA_CHANNEL_FILTER_LIST.

Properties

Name Description
AudioAttributes

Returns the audio attributes for sound played by notifications posted to this channel.

Blockable

Returns whether this channel is always blockable, even if the app is 'fixed' as non-blockable.

Class

Returns the runtime class of this Object.

(Inherited from Object)
ConversationId

Returns the id of the conversation backing this channel, if it's associated with a conversation.

Creator
Description

Returns the user visible description of this channel.

Group

Returns what group this channel belongs to.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
HasUserSetImportance

Returns whether the user has chosen the importance of this channel, either to affirm the initial selection from the app, or changed it to be higher or lower.

HasUserSetSound

Returns whether the user has chosen the sound of this channel.

Id

Returns the id of this channel.

Importance

Returns the user specified importance e.g.

IsConversation

Whether or not this channel represents a conversation.

IsDemoted

Returns whether the user has decided that this channel does not represent a conversation.

IsImportantConversation

Whether or not notifications in this conversation are considered important.

JniIdentityHashCode

Gets the identity hash code assigned to this Java peer by the interop runtime.

(Inherited from Object)
JniManagedPeerState (Inherited from JavaObject)
JniPeerMembers

Provides JNI binding infrastructure for Android.App.NotificationChannel.

LightColor

Returns the notification light color for notifications posted to this channel.

LockscreenVisibility

Returns whether or not notifications posted to this channel are shown on the lockscreen in full or redacted form.

Name
NameFormatted

Returns the user visible name of this channel.

OriginalImportance

Returns the app-defined importance for this channel, prior to any user modifications.

ParentChannelId

Returns the id of the parent notification channel to this channel, if it's a conversation related channel.

PeerReference

Gets the JNI object reference for this Java peer.

(Inherited from Object)
Sound

Returns the notification sound for this channel.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
VibrationEffect

Returns the VibrationEffect for notifications posted to this channel.

Methods

Name Description
CanBubble()

Returns whether notifications posted to this channel are allowed to display outside of the notification shade, in a floating window on top of other apps.

CanBypassDnd()

Whether or not notifications posted to this channel can bypass the Do Not Disturb NotificationManager.INTERRUPTION_FILTER_PRIORITY mode when the active policy allows priority channels to bypass notification filtering.

CanShowBadge()

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

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Construct(JniObjectReference, JniObjectReferenceOptions) (Inherited from JavaObject)
DescribeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

Dispose()

Releases the resources held by this Java peer.

(Inherited from Object)
Dispose(Boolean)

Releases the resources held by this Java peer.

(Inherited from Object)
DisposeUnlessReferenced() (Inherited from JavaObject)
EnableLights(Boolean)

Sets whether notifications posted to this channel should display notification lights, on devices that support that feature.

EnableVibration(Boolean)

Sets whether notification posted to this channel should vibrate.

Equals(Object) (Inherited from JavaObject)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetVibrationPattern()

Returns the vibration pattern for notifications posted to this channel.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetAllowBubbles(Boolean)

As of Android 11 this value is no longer respected.

SetBypassDnd(Boolean)

Sets whether or not notifications posted to this channel can interrupt the user in NotificationManager.INTERRUPTION_FILTER_PRIORITY mode.

SetConversationId(String, String)

Sets this channel as being converastion-centric.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetPeerReference(JniObjectReference, JniObjectReferenceOptions) (Inherited from JavaObject)
SetShowBadge(Boolean)

Sets whether notifications posted to this channel can appear as application icon badges in a Launcher.

SetSound(Uri, AudioAttributes)

Sets the sound that should be played for notifications posted to this channel and its audio attributes.

SetVibrationPattern(Int64[])

Sets the vibration pattern for notifications posted to this channel.

ShouldShowLights()

Returns whether notifications posted to this channel trigger notification lights.

ShouldVibrate()

Returns whether notifications posted to this channel always vibrate.

ToArray<T>()

Creates a managed array from this Java array wrapper.

(Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime()

Unregisters this Java peer from the interop runtime.

(Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
WriteToParcel(Parcel, ParcelableWriteFlags)

Flatten this object in to a Parcel.

Explicit Interface Implementations

Name Description
IJavaPeerable.Disposed() (Inherited from JavaObject)
IJavaPeerable.Finalized() (Inherited from JavaObject)
IJavaPeerable.JniObjectReferenceControlBlock (Inherited from JavaObject)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from JavaObject)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from JavaObject)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from JavaObject)
IJavaPeerable.UnregisterFromRuntime()

Extension Methods

Name Description
GetJniTypeName(IJavaPeerable)

Gets the JNI name of the type of the instance self.

JavaAs<TResult>(IJavaPeerable)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
TryJavaCast<TResult>(IJavaPeerable, TResult)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

Applies to