Android NotificationManager

class enamlnative.android.android_notification.NotificationManager(*args, **kwargs)[source]

Bases: enamlnative.android.bridge.JavaBridgeObject

Android NotificationManager. Use the show_notification and create_channel class methods.

classmethod instance() Optional[enamlnative.android.android_notification.NotificationManager][source]

Get an instance of this service if it was already requested.

You should request it first using NotificationManager.get()

__Example__

:::python

await NotificationManager.get()

async classmethod get() enamlnative.android.android_notification.NotificationManager[source]

Acquires the NotificationManager service async.

__init__(*args, **kwargs)[source]

Force only one instance to exist

async classmethod create_channel(channel_id: str, name: str, importance: int = 3, description: str = '') Optional[enamlnative.android.android_notification.NotificationChannel][source]

Before you can deliver the notification on Android 8.0 and higher, you must register your app’s notification channel with the system by passing an instance of NotificationChannel to createNotificationChannel().

Parameters
  • channel_id (String-) – Channel ID

  • name (String) – Channel name

  • importance (Int) – One of the IMPORTANCE levels

  • description (String) – Channel description

Returns

channel – The channel that was created.

Return type

NotificationChannel or None

classmethod show_notification(channel_id: int, *args, **kwargs)[source]

Create and show a Notification. See Notification.Builder.update for a list of accepted parameters.

async classmethod cancel_notification(notification_or_id, tag=None)[source]

Cancel the notification.

Parameters
  • notification_or_id (Notification.Builder or int) – The notification or id of a notification to clear

  • tag (String) – The tag of the notification to clear