Local notifications ignore iOS Focus mode interruption level and Android channel importance
0 reputation · 11 Mar 2021, 22:09 UTC
Goal
Schedule local notifications that remain silent when the user has enabled Focus mode on iOS or set a low‑importance channel on Android, avoiding unnecessary alert noise.
Constraints and uncertainty
- Titanium SDK 12.x uses
UserNotificationCenteron iOS 17+ andNotificationChannelon Android 14+; the legacyscheduleLocalNotificationAPI is deprecated. - iOS interruption level defaults to
active, which can override Focus mode unless explicitly set topassiveortimeSensitive. - Android channel importance is immutable after creation; an incorrect level requires the user to delete the channel or reinstall the app.
- The
POST_NOTIFICATIONSruntime permission on Android 13+ must be granted before posting, but the permission callback timing can race with notification scheduling. - No built‑in cross‑platform abstraction exists for these settings, so platform‑specific code is required.
What is the recommended way to set the interruption level per notification on iOS so that Focus mode respects it? How can an Android channel be created with the correct importance before the permission grant, ensuring the first notification honors that importance? Are there any Titanium SDK hooks or lifecycle events that guarantee the permission state is settled before scheduling?