AndroidOptions
Android-specific notification settings.
Importance, sound, vibration, lights, and badge behavior belong to the
notification's channel; see
NotificationChannel.
Properties
additional_flags- Additional native Android notification flags, combined using|.auto_cancel- Whether tapping the notification automatically dismisses it.badge_number- Notification count displayed by launchers that support badge numbers.category- Semantic category used by Android to rank and filter notifications.channel- Channel the notification is posted to.chronometer_count_down- Whether the chronometer counts down rather than up.color- Android notification accent color.colorized- Whether to usecolorfor the notification background.full_screen_intent- Whether to request full-screen presentation when the notification arrives.group- Group this notification belongs to.icon- Bundled drawable resource name for this notification's small icon.large_icon- Large image shown beside the notification content, such as a contact photo.led_off_duration- Time the notification LED remains off between blinks.led_on_duration- Time the notification LED remains on during each blink.ongoing- Whether to mark the notification as an ongoing activity.only_alert_once- Whether sound, vibration, and ticker alert only on the first display.priority- Notification priority.progress- Progress bar shown in the notification.shortcut_id- ID of a published, long-lived sharing shortcut linked to the notification.show_timestamp- Whether to display the notification timestamp.silent- Whether to suppress sound and vibration for this notification.style- Expanded layout of the notification; seeAndroidStyle.sub_text- Supplementary information displayed in the notification template.tag- Additional identifier for immediately displayed Android notifications.ticker- Ticker text sent to Android accessibility services.timeout_after- Time after posting before Android cancels the notification.timestamp- Time displayed on the notification.uses_chronometer- Whether to show elapsed time fromtimestampinstead of a timestamp.visibility- How much content may appear on a secure lock screen.
Properties
additional_flagsclass-attributeinstance-attribute
additional_flags: AndroidFlag | int | None = NoneAdditional native Android notification flags, combined using |.
For example, combine AndroidFlag.INSISTENT
and AndroidFlag.NO_CLEAR to request repeating
audio and retention when the user presses Clear all.
Android may restrict the effect of individual flags.
A raw integer bitmask is also accepted for Android flags not represented by
AndroidFlag. Combine integer flag values
using | in the same way. See Android's notification
flags for
their meanings and restrictions.
Flags are added after the notification is built. None or
AndroidFlag.NONE adds no flags and does not
clear flags set by other options. Prefer dedicated options such as ongoing
and auto_cancel when available.
auto_cancelclass-attributeinstance-attribute
auto_cancel: bool | None = NoneWhether tapping the notification automatically dismisses it.
badge_numberclass-attributeinstance-attribute
badge_number: int | None = NoneNotification count displayed by launchers that support badge numbers.
Ignored when the launcher does not support this feature.
categoryclass-attributeinstance-attribute
category: AndroidCategory | None = NoneSemantic category used by Android to rank and filter notifications.
See AndroidCategory for the supported
categories. This does not change the notification channel's importance.
channelclass-attributeinstance-attribute
channel: NotificationChannel | str | None = NoneChannel the notification is posted to.
Pass a NotificationChannel to create the channel on
first use, or the ID of a channel created earlier with
Notifications.create_channel. A
missing channel referenced only by ID is created with the name "Notifications"
and default settings. None uses the extension's default channel.
Before Android 8.0, which has no channels, the channel's sound, vibration, lights, and importance apply to the individual notification.
chronometer_count_downclass-attributeinstance-attribute
chronometer_count_down: bool | None = NoneWhether the chronometer counts down rather than up.
Supported only on Android 7.0+. Requires uses_chronometer to be enabled.
colorclass-attributeinstance-attribute
color: ColorValue | None = NoneAndroid notification accent color.
Accepts Flet color names and hexadecimal colors. Theme-dependent colors, such as
ft.Colors.PRIMARY, cannot be resolved by this headless service.
colorizedclass-attributeinstance-attribute
colorized: bool | None = NoneWhether to use color for the notification background.
When disabled, the color accents the app icon. Android usually restricts background coloring to foreground-service notifications.
full_screen_intentclass-attributeinstance-attribute
full_screen_intent: bool | None = NoneWhether to request full-screen presentation when the notification arrives.
Requires the "android.permission.USE_FULL_SCREEN_INTENT" permission in
[tool.flet.android.permission] and, on Android 14+, full-screen-intent
access. See
Notifications.request_full_screen_intent_permission.
Android may show a heads-up notification instead. A full-screen launch is
reported through Notifications.on_tap.
On a locked device, Android turns the screen on and starts the app, but the app stays behind the lock screen: the user sees the notification there and reaches the app after unlocking.
groupclass-attributeinstance-attribute
group: AndroidGroup | None = NoneGroup this notification belongs to.
None leaves the notification ungrouped.
iconclass-attributeinstance-attribute
icon: str | None = NoneBundled drawable resource name for this notification's small icon.
Supply the resource name without a file extension, such as "ic_stat_notify".
None uses Notifications.android_default_icon.
Use a white silhouette on a transparent background, with resources sized for the supported screen densities. Android Studio's notification icon wizard generates the appropriate drawable variants. Android uses the icon's alpha channel to determine its visible shape; an opaque background can appear as a solid block.
Add the drawable with the
res_dir build
setting, for example as drawable/ic_stat_notify.png. Bundled resources
exist only in apps built with
flet build or
flet debug; under
flet run, a missing icon raises
NotificationException.
large_iconclass-attributeinstance-attribute
large_icon: AndroidBitmap | None = NoneLarge image shown beside the notification content, such as a contact photo.
None shows no large icon.
led_off_durationclass-attributeinstance-attribute
led_off_duration: DurationValue | None = NoneTime the notification LED remains off between blinks.
Effective only before Android 8.0, where the LED blinks in the channel's
led_color only when both
led_on_duration and led_off_duration are set. On newer
versions, the device controls the blinking pattern.
led_on_durationclass-attributeinstance-attribute
led_on_duration: DurationValue | None = NoneTime the notification LED remains on during each blink.
Effective only before Android 8.0, where the LED blinks in the channel's
led_color only when both
led_on_duration and led_off_duration are set. On newer
versions, the device controls the blinking pattern.
ongoingclass-attributeinstance-attribute
ongoing: bool | None = NoneWhether to mark the notification as an ongoing activity.
Android controls whether the user can dismiss ongoing notifications; this does not start a foreground service.
only_alert_onceclass-attributeinstance-attribute
only_alert_once: bool | None = NoneWhether sound, vibration, and ticker alert only on the first display.
Enable when repeatedly updating the same notification, such as a progress notification, without alerting on each update.
priorityclass-attributeinstance-attribute
priority: AndroidPriority | None = NoneNotification priority.
Used on Android 7.1 and earlier. On Android 8.0+, the channel's
importance applies instead.
progressclass-attributeinstance-attribute
progress: AndroidProgress | None = NoneProgress bar shown in the notification.
None shows no progress bar.
shortcut_idclass-attributeinstance-attribute
shortcut_id: str | None = NoneID of a published, long-lived sharing shortcut linked to the notification.
On Android 11+, this can help a messaging notification appear in the conversation section. This extension does not create the shortcut.
show_timestampclass-attributeinstance-attribute
show_timestamp: bool | None = NoneWhether to display the notification timestamp.
Set timestamp to override the displayed time.
silentclass-attributeinstance-attribute
silent: bool | None = NoneWhether to suppress sound and vibration for this notification.
This is a per-notification setting, distinct from changing the channel's sound and vibration configuration.
styleclass-attributeinstance-attribute
style: AndroidStyle | None = NoneExpanded layout of the notification; see AndroidStyle.
None uses the standard layout.
sub_textclass-attributeinstance-attribute
sub_text: str | None = NoneSupplementary information displayed in the notification template.
Android 7.0+ places this in the header. Earlier versions use the same line as the progress bar, so avoid using both on those versions.
tagclass-attributeinstance-attribute
tag: str | None = NoneAdditional identifier for immediately displayed Android notifications.
The same (tag, id) pair replaces a visible notification. Pass the tag to
Notifications.cancel to remove it. Scheduled alarms
use only the notification ID, not this pair.
tickerclass-attributeinstance-attribute
ticker: str | None = NoneTicker text sent to Android accessibility services.
timeout_afterclass-attributeinstance-attribute
timeout_after: DurationValue | None = NoneTime after posting before Android cancels the notification.
None does not request automatic cancellation after a timeout.
timestampclass-attributeinstance-attribute
timestamp: datetime | None = NoneTime displayed on the notification.
When None, uses the notification's posting time. This does not schedule delivery;
use Notifications.schedule for that.
Timezone-aware values preserve their instant. A naive datetime is interpreted in the Python host's local timezone.
uses_chronometerclass-attributeinstance-attribute
uses_chronometer: bool | None = NoneWhether to show elapsed time from timestamp instead of a timestamp.
Android updates the minutes and seconds automatically, which is useful for ongoing calls or timers.
visibilityclass-attributeinstance-attribute
visibility: AndroidVisibility | None = NoneHow much content may appear on a secure lock screen.
None leaves the choice to Android. See
AndroidVisibility.