# Titanium.Android.NotificationManager

Module for managing notifications.

Availability
1.5

# Overview

This module provides methods for sending and canceling notifications, which are represented by the Titanium.Android.Notification object.

Further Reading:

# Methods

# areNotificationsEnabled

Availability
7.1.0
areNotificationsEnabled() Boolean

Returns whether showing notifications is enabled for the application.

Returns

Type
Boolean

# cancel

Availability
1.5
cancel(id) void

Cancels a previously displayed notification.

Parameters

Name Type Description
id Number

The ID passed to notify.

Returns

Type
void

# cancelAll

Availability
1.5
cancelAll() void

Cancels all previously displayed notifications.

Returns

Type
void

# createNotificationChannel

Availability
1.5
createNotificationChannel(parameters) Titanium.Android.NotificationChannel

Create a notification channel.

This will return null when used on Android versions lower than 8.0.

Parameters

Name Type Description
parameters Dictionary<Titanium.Android.NotificationChannel>

Properties to set on a new object, including any defined by Titanium.Android.NotificationChannel except those marked not-creation or read-only.

Returns


# deleteNotificationChannel

Availability
12.0.0
deleteNotificationChannel(id) void

Deletes a notification channel.

Parameters

Name Type Description
id String

The id of the channel

Returns

Type
void

# notify

Availability
1.5
notify(id, notification) void

Adds a persistent notification to the status bar.

The new notification replaces any previous notification with the same id.

Parameters

Name Type Description
id Number

An ID that may be used to cancel a shown notification.

notification Titanium.Android.Notification

Notification to display.

Returns

Type
void

# Constants

# DEFAULT_ALL

Availability
1.5
DEFAULT_ALL :Number

Use DEFAULT_ALL instead.


# DEFAULT_LIGHTS

Availability
1.5
DEFAULT_LIGHTS :Number

Use DEFAULT_LIGHTS instead.


# DEFAULT_SOUND

Availability
1.5
DEFAULT_SOUND :Number

Use DEFAULT_SOUND instead.


# DEFAULT_VIBRATE

Availability
1.5
DEFAULT_VIBRATE :Number

Use DEFAULT_VIBRATE instead.


# FLAG_AUTO_CANCEL

Availability
1.5
FLAG_AUTO_CANCEL :Number

Use FLAG_AUTO_CANCEL instead.


# FLAG_INSISTENT

Availability
1.5
FLAG_INSISTENT :Number

Use FLAG_INSISTENT instead.


# FLAG_NO_CLEAR

Availability
1.5
FLAG_NO_CLEAR :Number

Use FLAG_NO_CLEAR instead.


# FLAG_ONGOING_EVENT

Availability
1.5
FLAG_ONGOING_EVENT :Number

Use FLAG_ONGOING_EVENT instead.


# FLAG_ONLY_ALERT_ONCE

Availability
1.5
FLAG_ONLY_ALERT_ONCE :Number

Use FLAG_ONLY_ALERT_ONCE instead.


# FLAG_SHOW_LIGHTS

Availability
1.5
FLAG_SHOW_LIGHTS :Number

Use FLAG_SHOW_LIGHTS instead.


# STREAM_DEFAULT

Availability
1.5
STREAM_DEFAULT :Number

Use STREAM_DEFAULT instead.