AndroidFlag
Additional behavior bits for an Android notification.
Combine members with | and pass the result to
AndroidOptions.additional_flags.
These bits are added after the notification is built; they cannot clear flags set by other options. Android's notification permissions, channel settings, and platform restrictions still apply.
import flet_notifications as ftn
options = ftn.AndroidOptions(
additional_flags=ftn.AndroidFlag.INSISTENT | ftn.AndroidFlag.NO_CLEAR
)
Deprecated flags and system-managed status flags are omitted. To start a foreground
service, use Notifications.start_foreground_service.
See Android's notification
flags.
Inherits: enum.IntFlag
Properties
AUTO_CANCEL- Cancels the notification when the user taps it.GROUP_SUMMARY- Marks the notification as the summary of a group.INSISTENT- Requests repeating audio until cancellation or the notification window is opened.LOCAL_ONLY- Marks the notification as relevant only to the current device.NO_CLEAR- Requests that the notification remain when the user presses Clear all.NONE- Adds no flags; flags set by other notification options remain in effect.ONGOING_EVENT- Marks the notification as representing work currently in progress, such as a call.ONLY_ALERT_ONCE- Alerts only when the notification is first posted, rather than on later updates.
Properties
AUTO_CANCELclass-attributeinstance-attribute
Cancels the notification when the user taps it.
Prefer AndroidOptions.auto_cancel for this behavior.
GROUP_SUMMARYclass-attributeinstance-attribute
Marks the notification as the summary of a group.
Requires AndroidOptions.group. Prefer setting
AndroidGroup.summary for this behavior.
INSISTENTclass-attributeinstance-attribute
Requests repeating audio until cancellation or the notification window is opened.
Sound must be enabled and permitted by the notification's channel and user settings.
LOCAL_ONLYclass-attributeinstance-attribute
Marks the notification as relevant only to the current device.
Recommends that the notification not be bridged to other devices.
NO_CLEARclass-attributeinstance-attribute
Requests that the notification remain when the user presses Clear all.
This does not prevent the app from cancelling the notification or guarantee that the notification cannot be dismissed individually.
NONEclass-attributeinstance-attribute
Adds no flags; flags set by other notification options remain in effect.
ONGOING_EVENTclass-attributeinstance-attribute
Marks the notification as representing work currently in progress, such as a call.
Prefer AndroidOptions.ongoing for this behavior.
ONLY_ALERT_ONCEclass-attributeinstance-attribute
Alerts only when the notification is first posted, rather than on later updates.
Also stops ongoing sound, vibration, or notification-LED alerting. Prefer
AndroidOptions.only_alert_once for this behavior.