# Titanium.Android.NotificationChannel

> Module for notification channels.

- Source: https://titaniumsdk.com/docs/sdk/13.0.0/Titanium.Android.NotificationChannel
- Titanium SDK version: 13.0.0
- Kind: proxy
- Platforms: Android
- Since: Titanium SDK 7.0.0
- Extends: Titanium.Proxy
- Inheritance: Titanium.Proxy

You can create a notification channel for each distinct type of notification you need to send.

To create a notification channel, use the [Titanium.Android.createNotificationChannel](https://titaniumsdk.com/docs/sdk/Titanium.Android.md#createNotificationChannel) method.

Further Reading:

  * [Android Developers: Notification Channel](https://developer.android.com/reference/android/app/NotificationChannel.html)

## Example: Notification Channel Example

The following example shows how to create a notification with a channel.

``` js
var channel = Ti.Android.NotificationManager.createNotificationChannel({
        id: 'my_channel',
        name: 'TEST CHANNEL',
        importance: Ti.Android.IMPORTANCE_DEFAULT
    }),
    notification = Ti.Android.createNotification({
        icon: Ti.Android.R.drawable.ic_dialog_info,
        contentTitle: 'TITLE',
        contentText : 'This is a test',
        channelId: channel.id
    });

Ti.Android.NotificationManager.notify(100, notification);
```

## Properties

### bypassDnd

- Type: Boolean
- Platforms: Android

Whether or not notifications posted to this channel can interrupt the user.

### description

- Type: String
- Platforms: Android

User visible description of this channel.

### enableLights

- Type: Boolean
- Platforms: Android

Whether notifications posted to this channel should display notification lights

### enableVibration

- Type: Boolean
- Platforms: Android

Whether notification posted to this channel should vibrate.

### groupId

- Type: String
- Platforms: Android

Group id this channel belongs to.

### id

- Type: String
- Platforms: Android

The channel id specified for the notification channel.

### importance

- Type: Number
- Platforms: Android

The audio stream type to use when playing the sound.

Specify one of the `IMPORTANCE` constants from [Titanium.Android](https://titaniumsdk.com/docs/sdk/Titanium.Android.md).

Accepts: `Titanium.Android.IMPORTANCE_DEFAULT`, `Titanium.Android.IMPORTANCE_HIGH`, `Titanium.Android.IMPORTANCE_LOW`, `Titanium.Android.IMPORTANCE_MAX`, `Titanium.Android.IMPORTANCE_MIN`, `Titanium.Android.IMPORTANCE_NONE`, `Titanium.Android.IMPORTANCE_UNSPECIFIED`

### lightColor

- Type: Number
- Platforms: Android

The notification light color for notifications posted to this channel.

### lockscreenVisibility

- Type: Number
- Platforms: Android

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

Accepts: `Titanium.Android.VISIBILITY_PRIVATE`, `Titanium.Android.VISIBILITY_PUBLIC`, `Titanium.Android.VISIBILITY_SECRET`

### name

- Type: String
- Platforms: Android

The visible name of this channel.
The recommended maximum length is 40 characters; the value may be truncated if it is too long.

### showBadge

- Type: Boolean
- Platforms: Android

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

### sound

- Type: String
- Platforms: Android
- Since: Titanium SDK 7.5.0

A URL to the sound to play.

The URL cannot refer to a file in the Resources directory, but it can refer to
a file in the raw resources directory
([Filesystem.resRawDirectory](https://titaniumsdk.com/docs/sdk/Titanium.Filesystem.md#resRawDirectory)).

To create a raw resource, place the audio file in the `platform/android/res/raw`
folder and reference it as:

``` js
notificationChannel.sound = Ti.Filesystem.resRawDirectory + 'my_sound.wav';
```

### vibratePattern

- Type: Array<Number>
- Platforms: Android

The vibration pattern for notifications posted to this channel.

Specify the pattern in milliseconds as an array. (e.g [100, 100, 100, 400, 400, 100, 100, 100])

## Inherited members

7 members are inherited. Each is documented on the type that declares it.

- [Titanium.Proxy](https://titaniumsdk.com/docs/sdk/13.0.0/Titanium.Proxy.md): `addEventListener`, `apiName`, `applyProperties`, `bubbleParent`, `fireEvent`, `lifecycleContainer`, `removeEventListener`

---

- This corpus documents Titanium SDK 13.4.1. Anything here that does not name a version describes 13.4.1.
- Titanium is maintained by TiDev. The Appcelerator toolchain is retired: there is no `appc` CLI, no Appcelerator Studio and no hosted build service. The supported CLI is `titanium` on npm, invoked as `ti`.

