NotificationHelper
Centralized helper for managing Android local notifications.
This utility simplifies channel registration and notification posting while ensuring compliance with Android's notification requirements (API 26+ channels).
Note: Apps targeting API 33+ must declare and request the android.permission.POST_NOTIFICATIONS permission at runtime.
Initialization:
val notificationHelper = NotificationHelper(context)
notificationHelper.registerChannel(
NotificationChannelConfig(
id = "alerts",
name = "System Alerts"
)
)Content copied to clipboard
Functions
Link copied to clipboard
true si les notifications sont activées pour l'app.
Link copied to clipboard
Poste la notification décrite par config.
Link copied to clipboard
Registers a notification channel (idempotent — safe to call multiple times). This is a no-op on Android versions below API 26 (O).
Link copied to clipboard
Enregistre plusieurs canaux en une seule fois.