AndroidNotificationScheduler

class AndroidNotificationScheduler(context: Context, channelId: String = DEFAULT_CHANNEL_ID, channelName: String = "General", importance: Int = NotificationManager.IMPORTANCE_DEFAULT) : NotificationScheduler

Android NotificationScheduler backed by NotificationManagerCompat.

Posts to a single configurable channel — channelId/channelName/importance — created on first use if missing. An app with its own multi-channel model (urgent/tracking/general, …) should ensure those channels itself and pass its "general"-equivalent id here; this class does not assume or manage any channel other than the one it's given.

ensurePermission only checks whether notifications are enabled (POST_NOTIFICATIONS on API 33+); actually requesting the runtime permission is PermissionsProvider's job, since it needs an Activity.

Constructors

Link copied to clipboard
constructor(context: Context, channelId: String = DEFAULT_CHANNEL_ID, channelName: String = "General", importance: Int = NotificationManager.IMPORTANCE_DEFAULT)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun cancel(id: Int)
Link copied to clipboard
open suspend override fun ensurePermission(): Boolean
Link copied to clipboard
open override fun notify(id: Int, title: String, body: String)