react-native-notify-kit 10.0.0 → 10.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +168 -100
- package/android/build.gradle +2 -2
- package/android/src/androidTest/java/app/notifee/core/RebootRecoveryTest.java +94 -2
- package/android/src/main/AndroidManifest.xml +8 -7
- package/android/src/main/java/app/notifee/core/ForegroundService.java +1 -0
- package/android/src/main/java/app/notifee/core/NotificationManager.java +8 -0
- package/android/src/main/java/app/notifee/core/RebootBroadcastReceiver.java +16 -0
- package/android/src/main/java/app/notifee/core/model/NotificationAndroidModel.java +8 -3
- package/android/src/main/java/app/notifee/core/model/TimestampTriggerModel.java +42 -27
- package/android/src/main/java/app/notifee/core/utility/ResourceUtils.java +30 -1
- package/android/src/main/kotlin/io/invertase/notifee/NotifeeApiModule.kt +6 -6
- package/android/src/test/java/app/notifee/core/model/NotificationAndroidModelSmallIconFallbackTest.java +74 -0
- package/android/src/test/java/app/notifee/core/model/TimestampTriggerModelTest.java +154 -0
- package/android/src/test/java/app/notifee/core/utility/ResourceUtilsFallbackIconTest.java +116 -0
- package/dist/types/Module.d.ts +7 -7
- package/dist/types/Notification.d.ts +1 -1
- package/dist/types/NotificationIOS.d.ts +44 -21
- package/dist/types/NotificationIOS.js +15 -1
- package/dist/types/NotificationIOS.js.map +1 -1
- package/dist/types/Trigger.d.ts +45 -2
- package/dist/types/Trigger.js +22 -0
- package/dist/types/Trigger.js.map +1 -1
- package/dist/validators/validateIOSCategory.js +2 -2
- package/dist/validators/validateIOSCategory.js.map +1 -1
- package/dist/validators/validateTrigger.js +42 -1
- package/dist/validators/validateTrigger.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/ios/NotifeeCore/NotifeeCore+NSNotificationCenter.m +20 -10
- package/ios/NotifeeCore/NotifeeCore+UNUserNotificationCenter.h +1 -2
- package/ios/NotifeeCore/NotifeeCore+UNUserNotificationCenter.m +44 -35
- package/ios/NotifeeCore/NotifeeCore.m +1035 -99
- package/ios/NotifeeCore/NotifeeCoreUtil.h +36 -1
- package/ios/NotifeeCore/NotifeeCoreUtil.m +533 -9
- package/ios/RNNotifee/NotifeeApiModule.mm +2 -2
- package/package.json +1 -1
- package/server/README.md +4 -4
- package/src/types/Module.ts +7 -7
- package/src/types/Notification.ts +1 -1
- package/src/types/NotificationIOS.ts +43 -28
- package/src/types/Trigger.ts +45 -1
- package/src/validators/validateIOSCategory.ts +4 -2
- package/src/validators/validateTrigger.ts +62 -0
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
|
+
<!-- markdownlint-disable MD033 MD041 -->
|
|
2
|
+
<p align="center">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/marcocrupi/react-native-notify-kit/main/docs/assets/logo.png" alt="react-native-notify-kit" width="160" />
|
|
4
|
+
</p>
|
|
5
|
+
|
|
1
6
|
# react-native-notify-kit
|
|
2
7
|
|
|
3
|
-
Maintained Notifee-compatible fork
|
|
8
|
+
Maintained Notifee-compatible fork: a feature-rich React Native notification library (Android & iOS).
|
|
4
9
|
|
|
5
|
-
<!-- markdownlint-disable MD033 -->
|
|
6
10
|
<p align="center">
|
|
7
11
|
<a href="https://www.npmjs.com/package/react-native-notify-kit"><img src="https://img.shields.io/npm/v/react-native-notify-kit.svg" alt="npm version"></a>
|
|
8
12
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue.svg" alt="License"></a>
|
|
9
13
|
<img src="https://img.shields.io/badge/platform-Android%20%7C%20iOS-green.svg" alt="Platform">
|
|
10
14
|
<img src="https://img.shields.io/badge/React%20Native-%3E%3D0.73-blue.svg" alt="React Native">
|
|
15
|
+
<a href="https://docs.page/marcocrupi/react-native-notify-kit/react-native/overview"><img src="https://img.shields.io/badge/docs-docs.page-blue.svg" alt="Documentation"></a>
|
|
11
16
|
</p>
|
|
12
17
|
|
|
13
18
|
<hr/>
|
|
14
19
|
|
|
20
|
+
> 📘 **Full documentation:** [docs.page/marcocrupi/react-native-notify-kit](https://docs.page/marcocrupi/react-native-notify-kit/react-native/overview) — public API reference, platform guides, FCM Mode, server SDK, and the `init-nse` CLI.
|
|
21
|
+
|
|
15
22
|
An actively maintained fork of Notifee for React Native notifications, continued and improved by Marco Crupi.
|
|
16
23
|
|
|
17
24
|
This repository preserves the original Notifee APIs and native core while continuing development for modern React Native releases.
|
|
@@ -135,6 +142,14 @@ useEffect(() => {
|
|
|
135
142
|
}, []);
|
|
136
143
|
```
|
|
137
144
|
|
|
145
|
+
> **Which handler fires when (iOS):**
|
|
146
|
+
>
|
|
147
|
+
> - Tap a notification while the app is **active in foreground** → `onForegroundEvent` receives `PRESS`.
|
|
148
|
+
> - Tap a notification while the app is **in background or killed** → `onBackgroundEvent` receives `PRESS`, even though iOS immediately brings the app to the foreground right after. At the moment iOS delivers the tap to the delegate, `UIApplication.applicationState` is `Inactive`, not `Active`, so the event is routed to the background handler.
|
|
149
|
+
> - Foreground delivery of a Notifee-owned notification → `onForegroundEvent` receives `DELIVERED`.
|
|
150
|
+
>
|
|
151
|
+
> Register **both** handlers if you need to react to taps in every app state. Resolves the confusion reported in upstream [invertase/notifee#1155](https://github.com/invertase/notifee/issues/1155).
|
|
152
|
+
|
|
138
153
|
## Notifee FCM Mode (NEW in 10.0.0)
|
|
139
154
|
|
|
140
155
|
**Use `react-native-notify-kit` as the sole FCM display layer on both Android and iOS** — one developer API, no duplicate notifications on Android, no silent-push drops on iOS. Ship a server SDK payload, let the client handle it in one line, and scaffold the iOS Notification Service Extension with a single CLI command:
|
|
@@ -151,13 +166,13 @@ await notifee.handleFcmMessage(remoteMessage);
|
|
|
151
166
|
npx react-native-notify-kit init-nse && cd ios && pod install
|
|
152
167
|
```
|
|
153
168
|
|
|
154
|
-
See the full guide: **[docs/fcm-mode.
|
|
169
|
+
See the full guide: **[docs/fcm-mode.mdx](docs/fcm-mode.mdx)** — covers architecture, server SDK reference, client API, NSE setup, payload schema, migration, troubleshooting, and known limitations.
|
|
155
170
|
|
|
156
171
|
## Push Notifications (Firebase)
|
|
157
172
|
|
|
158
173
|
This library handles notification **display and management**. For receiving push notifications, pair it with [`@react-native-firebase/messaging`](https://rnfirebase.io/messaging/usage):
|
|
159
174
|
|
|
160
|
-
> **New in 10.0.0:** for a turnkey FCM integration that handles both platforms (no duplicate on Android, APNs-reliable on iOS), use **[Notifee FCM Mode](docs/fcm-mode.
|
|
175
|
+
> **New in 10.0.0:** for a turnkey FCM integration that handles both platforms (no duplicate on Android, APNs-reliable on iOS), use **[Notifee FCM Mode](docs/fcm-mode.mdx)** instead of the manual pattern below. The sections that follow still apply for basic Firebase setup (google-services plugin, permissions, APNs capability).
|
|
161
176
|
|
|
162
177
|
### Android setup
|
|
163
178
|
|
|
@@ -227,7 +242,7 @@ npx react-native-notify-kit init-nse
|
|
|
227
242
|
cd ios && pod install
|
|
228
243
|
```
|
|
229
244
|
|
|
230
|
-
The CLI scaffolds a Swift NSE target (default name: `NotifyKitNSE`), patches your Podfile, and wires `.pbxproj`. Open your `.xcworkspace` in Xcode, verify the NSE target's signing, and build. See [docs/fcm-mode.
|
|
245
|
+
The CLI scaffolds a Swift NSE target (default name: `NotifyKitNSE`), patches your Podfile, and wires `.pbxproj`. Open your `.xcworkspace` in Xcode, verify the NSE target's signing, and build. See [docs/fcm-mode.mdx#ios-nse-setup](docs/fcm-mode.mdx#ios-nse-setup) for the full CLI reference (target name, bundle suffix, `--dry-run`, `--force`).
|
|
231
246
|
|
|
232
247
|
### Manual setup
|
|
233
248
|
|
|
@@ -293,13 +308,13 @@ const message = buildNotifyKitPayload({
|
|
|
293
308
|
await admin.messaging().send(message);
|
|
294
309
|
```
|
|
295
310
|
|
|
296
|
-
Full reference: [docs/fcm-mode.
|
|
311
|
+
Full reference: [docs/fcm-mode.mdx#server-sdk-reference](docs/fcm-mode.mdx#server-sdk-reference) (types, validation rules, payload shape, FCM 4 KB limit).
|
|
297
312
|
|
|
298
313
|
## CLI Tools
|
|
299
314
|
|
|
300
315
|
The library ships a small CLI at `npx react-native-notify-kit`. Currently one command is available:
|
|
301
316
|
|
|
302
|
-
- `npx react-native-notify-kit init-nse` — scaffolds an iOS Notification Service Extension (Swift), patches the Podfile, and wires `.pbxproj`. See [docs/fcm-mode.
|
|
317
|
+
- `npx react-native-notify-kit init-nse` — scaffolds an iOS Notification Service Extension (Swift), patches the Podfile, and wires `.pbxproj`. See [docs/fcm-mode.mdx#ios-nse-setup](docs/fcm-mode.mdx#ios-nse-setup) for options.
|
|
303
318
|
|
|
304
319
|
The CLI is prepacked into the main package at publish time, so `npx react-native-notify-kit` works immediately after `yarn add react-native-notify-kit` — no separate install.
|
|
305
320
|
|
|
@@ -332,8 +347,9 @@ This fork is a complete migration to React Native's **New Architecture**:
|
|
|
332
347
|
- **Toolchain**: Yarn 4, Node 22+, Java 17, compileSdk/targetSdk 35
|
|
333
348
|
- **Single Android module** — the original Notifee shipped a pre-compiled AAR bundled inside the npm tarball under a frozen Maven coordinate; this fork compiles the core from source as part of the React Native bridge module on every consumer build. Eliminates the `FAIL_ON_PROJECT_REPOS` issue on RN 0.74+ and the Gradle cache staleness bug that could serve outdated bytecode after `yarn upgrade`.
|
|
334
349
|
- **Core notification logic (NotifeeCore) is unchanged** — the public API is fully compatible with the original Notifee
|
|
335
|
-
- **
|
|
350
|
+
- **35 upstream bugs fixed** — see [Bugs Fixed from Upstream Notifee](#bugs-fixed-from-upstream-notifee) below
|
|
336
351
|
- **Reliable trigger notifications** — AlarmManager is the default backend instead of WorkManager, with automatic fallback when exact alarm permission is not granted
|
|
352
|
+
- **Custom repeat intervals for timestamp triggers** — `TimestampTrigger.repeatInterval` supports calendar-based recurrences such as every 2 days, every 2 weeks, or every 3 months from a selected start timestamp. On iOS, repeating timestamp triggers now use a bounded rolling schedule of one-shot local notifications instead of native repeating calendar triggers; this enables custom repeat intervals and start-date-respecting recurrence, but apps that relied on native iOS repeating triggers being scheduled indefinitely should review the iOS notes in the [Triggers guide](docs/react-native/triggers.mdx#custom-repeat-intervals).
|
|
337
353
|
- **New API: `setNotificationConfig()`** — opt-out flag to prevent Notifee from intercepting iOS remote notification handlers (see [New APIs](#new-apis) below)
|
|
338
354
|
- **Baseline Profile** — the library AAR ships a Baseline Profile that instructs ART to AOT-compile the foreground service notification hot path at install time, eliminating JIT penalty on first invocation
|
|
339
355
|
|
|
@@ -341,41 +357,44 @@ This fork is a complete migration to React Native's **New Architecture**:
|
|
|
341
357
|
|
|
342
358
|
This fork fixes the following bugs that were never resolved in the original Notifee repository:
|
|
343
359
|
|
|
344
|
-
| Bug
|
|
345
|
-
|
|
|
346
|
-
| Notifee intercepts iOS remote notification tap handlers, breaking RNFB `onNotificationOpenedApp` / `getInitialNotification`
|
|
347
|
-
| `completionHandler` not called on notification dismiss
|
|
348
|
-
| `completionHandler` not called in `willPresentNotification` fallback
|
|
349
|
-
| `getInitialNotification()` returns `null` on cold start (deprecated `UIApplicationLaunchOptionsLocalNotificationKey` check)
|
|
350
|
-
| `willPresentNotification:` fallback silently drops foreground notifications when no original delegate is captured (returns `None` instead of platform defaults)
|
|
351
|
-
| All delivered notifications dismissed from Notification Center when the app is opened
|
|
352
|
-
| `getInitialNotification()` returns `null` without `pressAction` configured
|
|
353
|
-
| Foreground press events silently dropped when React instance not ready
|
|
354
|
-
| Trigger notifications not firing on Android 14-15 when app is killed (missing `goAsync()` in `BroadcastReceiver`)
|
|
355
|
-
| `SCHEDULE_EXACT_ALARM` denial silently drops scheduled alarms (no fallback)
|
|
356
|
-
| `getNotificationSettings()` returns `DENIED` instead of `NOT_DETERMINED` on Android 13+ before permission requested
|
|
357
|
-
| Default `AlarmType.SET_EXACT` doesn't work in Doze mode; `AlarmType.SET` uses `RTC` instead of `RTC_WAKEUP`
|
|
358
|
-
| Foreground service crashes with ANR after ~3 min on Android 14+ (`shortService` timeout, missing `onTimeout()`)
|
|
359
|
-
| Manifest merger failure when overriding `foregroundServiceType` on `ForegroundService`
|
|
360
|
-
| Foreground service notifications dismissible on Android 13+ even with `ongoing: true` (library doesn't auto-set `ongoing` for foreground services)
|
|
361
|
-
| DST (daylight saving time) shifts repeating scheduled notifications by ±1 hour
|
|
362
|
-
| `!=` reference equality on String comparison in `NotificationPendingIntent` (latent — would activate when `getLaunchActivity()` returns a non-null value for `id=default`)
|
|
363
|
-
| `pressAction.launchActivity` not defaulted at native layer when `pressAction.id === 'default'`
|
|
364
|
-
| Duplicate symbols linker error when using NSE (`$NotifeeExtension = true`) with static frameworks — `NotifeeExtensionHelper` compiled by both `RNNotifee` and `RNNotifeeCore` pods
|
|
365
|
-
| `FAIL_ON_PROJECT_REPOS` rejection
|
|
366
|
-
| Stale Gradle cache could serve outdated AAR bytecode after `yarn upgrade` — same Maven coordinate reused across releases violated Gradle's coordinate-immutability assumption
|
|
367
|
-
| `EventType.DELIVERED` not emitted for `displayNotification()` in foreground (only for trigger notifications) — `notifeeTrigger != nil` guard in `willPresentNotification:` suppressed the event, breaking iOS/Android symmetry
|
|
368
|
-
| Tapping a notification without explicit `pressAction` does nothing (app doesn't open) — `NotificationPendingIntent.createIntent()` creates a tap-less PendingIntent when `pressActionModelBundle` is null, especially visible on trigger notifications after app kill
|
|
369
|
-
| Foreground service notifications delayed up to 10 seconds on Android 12+ — library never calls `setForegroundServiceBehavior(FOREGROUND_SERVICE_IMMEDIATE)`
|
|
370
|
-
| `didReceiveNotificationResponse:` completionHandler delayed by 15 seconds via `dispatch_after`, blocking subsequent notification taps and risking handler leaks if the app is suspended during the wait
|
|
371
|
-
| `requestPermission:` silently swallows `NSError` from `requestAuthorizationWithOptions`, making MDM and parental-control authorization failures invisible to JS consumers
|
|
372
|
-
| `contentByUpdatingWithProvider:` errors suppressed via `nil` error pointer in `displayNotification:` and `createTriggerNotification:` — communication notifications with malformed SiriKit intents silently fail with nil content
|
|
373
|
-
| `getBadgeCount:` completion block never called when running in an app extension, causing JS promises to hang forever in NSE handlers
|
|
374
|
-
| Notification Service Extension attachment downloads had no timeout cap (default 60-second `NSURLSession` timeout exceeds iOS's ~30-second NSE budget), causing extension process kill and notification loss on slow networks
|
|
375
|
-
| `cancelTriggerNotifications()` / `createTriggerNotification()` promises resolve before Room DB write completes, causing ~3% race on cancel-then-create patterns. Also fixes a previously-undocumented reboot-recovery data-loss bug in `NotifeeAlarmManager.rescheduleNotification` and an ordering bug in `NotificationManager.doScheduledWork`
|
|
376
|
-
| Scheduled trigger notifications silently lost across device reboot on OEM devices (Xiaomi MIUI, OnePlus, Huawei EMUI, Oppo ColorOS, Vivo FuntouchOS) whose vendor OS suppresses `BOOT_COMPLETED` until the user manually enables autostart. Also handles zombie non-repeating triggers whose fire time already passed (fire-once within a 24-hour grace period, then delete the Room row; delete silently beyond the grace period) and adds try/catch/finally guards to all notifee `BroadcastReceiver` async paths. | Android
|
|
377
|
-
| `
|
|
378
|
-
| `
|
|
360
|
+
| Bug | Platform | Upstream Issue | Fixed in |
|
|
361
|
+
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
362
|
+
| Notifee intercepts iOS remote notification tap handlers, breaking RNFB `onNotificationOpenedApp` / `getInitialNotification` | iOS | [#912](https://github.com/invertase/notifee/issues/912) | 9.1.12 |
|
|
363
|
+
| `completionHandler` not called on notification dismiss | iOS | Pre-existing | 9.1.12 |
|
|
364
|
+
| `completionHandler` not called in `willPresentNotification` fallback | iOS | Pre-existing | 9.1.12 |
|
|
365
|
+
| `getInitialNotification()` returns `null` on cold start (deprecated `UIApplicationLaunchOptionsLocalNotificationKey` check) | iOS | [#1128](https://github.com/invertase/notifee/issues/1128) | 9.1.12 |
|
|
366
|
+
| `willPresentNotification:` fallback silently drops foreground notifications when no original delegate is captured (returns `None` instead of platform defaults) | iOS | Pre-existing (introduced by partial fix in v9.1.12) | 9.1.20 |
|
|
367
|
+
| All delivered notifications dismissed from Notification Center when the app is opened | iOS | [#828](https://github.com/invertase/notifee/issues/828) | 9.1.20 |
|
|
368
|
+
| `getInitialNotification()` returns `null` without `pressAction` configured | Android | [#1128](https://github.com/invertase/notifee/issues/1128) | 9.1.12 |
|
|
369
|
+
| Foreground press events silently dropped when React instance not ready | Android | [#1279](https://github.com/invertase/notifee/issues/1279) | 9.1.12 |
|
|
370
|
+
| Trigger notifications not firing on Android 14-15 when app is killed (missing `goAsync()` in `BroadcastReceiver`) | Android | [#1100](https://github.com/invertase/notifee/issues/1100) | 9.1.12 |
|
|
371
|
+
| `SCHEDULE_EXACT_ALARM` denial silently drops scheduled alarms (no fallback) | Android | [#1100](https://github.com/invertase/notifee/issues/1100) | 9.1.12 |
|
|
372
|
+
| `getNotificationSettings()` returns `DENIED` instead of `NOT_DETERMINED` on Android 13+ before permission requested | Android | [#1237](https://github.com/invertase/notifee/issues/1237) | 9.1.12 |
|
|
373
|
+
| Default `AlarmType.SET_EXACT` doesn't work in Doze mode; `AlarmType.SET` uses `RTC` instead of `RTC_WAKEUP` | Android | [#961](https://github.com/invertase/notifee/issues/961) | 9.1.12 |
|
|
374
|
+
| Foreground service crashes with ANR after ~3 min on Android 14+ (`shortService` timeout, missing `onTimeout()`) | Android | [#703](https://github.com/invertase/notifee/issues/703), [#1107](https://github.com/invertase/notifee/issues/1107) | 9.1.13 |
|
|
375
|
+
| Manifest merger failure when overriding `foregroundServiceType` on `ForegroundService` | Android | [#1108](https://github.com/invertase/notifee/issues/1108) | 9.1.13 |
|
|
376
|
+
| Foreground service notifications dismissible on Android 13+ even with `ongoing: true` (library doesn't auto-set `ongoing` for foreground services) | Android | [#1248](https://github.com/invertase/notifee/issues/1248) | 9.1.14 |
|
|
377
|
+
| DST (daylight saving time) shifts repeating scheduled notifications by ±1 hour | Android | [#875](https://github.com/invertase/notifee/issues/875) | 9.1.14 |
|
|
378
|
+
| `!=` reference equality on String comparison in `NotificationPendingIntent` (latent — would activate when `getLaunchActivity()` returns a non-null value for `id=default`) | Android | Pre-existing (latent) | 9.1.19 |
|
|
379
|
+
| `pressAction.launchActivity` not defaulted at native layer when `pressAction.id === 'default'` | Android | N/A (defense-in-depth) | 9.1.19 |
|
|
380
|
+
| Duplicate symbols linker error when using NSE (`$NotifeeExtension = true`) with static frameworks — `NotifeeExtensionHelper` compiled by both `RNNotifee` and `RNNotifeeCore` pods | iOS | Pre-existing | 9.1.22 |
|
|
381
|
+
| `Could not resolve app.notifee:core:+` / `FAIL_ON_PROJECT_REPOS` rejection — library injected a Maven repository into the consumer's `rootProject.allprojects` block, which broke on (a) RN 0.74+ with `dependencyResolutionManagement`, (b) Expo SDK 53/54 where `extraMavenRepos` is not propagated to subprojects, and (c) Gradle 8 dependency locking with legacy XML parsers | Android | [#1079](https://github.com/invertase/notifee/issues/1079), [#1226](https://github.com/invertase/notifee/issues/1226), [#1262](https://github.com/invertase/notifee/issues/1262) | 9.2.0 |
|
|
382
|
+
| Stale Gradle cache could serve outdated AAR bytecode after `yarn upgrade` — same Maven coordinate reused across releases violated Gradle's coordinate-immutability assumption | Android | N/A (architectural) | 9.2.0 |
|
|
383
|
+
| `EventType.DELIVERED` not emitted for `displayNotification()` in foreground (only for trigger notifications) — `notifeeTrigger != nil` guard in `willPresentNotification:` suppressed the event, breaking iOS/Android symmetry | iOS | Pre-existing | 9.3.0 |
|
|
384
|
+
| Tapping a notification without explicit `pressAction` does nothing (app doesn't open) — `NotificationPendingIntent.createIntent()` creates a tap-less PendingIntent when `pressActionModelBundle` is null, especially visible on trigger notifications after app kill | Android | Pre-existing (latent), [#291](https://github.com/invertase/notifee/issues/291) | 9.3.0 |
|
|
385
|
+
| Foreground service notifications delayed up to 10 seconds on Android 12+ — library never calls `setForegroundServiceBehavior(FOREGROUND_SERVICE_IMMEDIATE)` | Android | [#272](https://github.com/invertase/notifee/issues/272), [#1242](https://github.com/invertase/notifee/issues/1242) | 9.4.0 |
|
|
386
|
+
| `didReceiveNotificationResponse:` completionHandler delayed by 15 seconds via `dispatch_after`, blocking subsequent notification taps and risking handler leaks if the app is suspended during the wait | iOS | Pre-existing (TODO since 2020) | 9.4.0 |
|
|
387
|
+
| `requestPermission:` silently swallows `NSError` from `requestAuthorizationWithOptions`, making MDM and parental-control authorization failures invisible to JS consumers | iOS | Pre-existing (TODO since day 1) | 9.4.0 |
|
|
388
|
+
| `contentByUpdatingWithProvider:` errors suppressed via `nil` error pointer in `displayNotification:` and `createTriggerNotification:` — communication notifications with malformed SiriKit intents silently fail with nil content | iOS | Pre-existing | 9.4.0 |
|
|
389
|
+
| `getBadgeCount:` completion block never called when running in an app extension, causing JS promises to hang forever in NSE handlers | iOS | Pre-existing | 9.4.0 |
|
|
390
|
+
| Notification Service Extension attachment downloads had no timeout cap (default 60-second `NSURLSession` timeout exceeds iOS's ~30-second NSE budget), causing extension process kill and notification loss on slow networks | iOS | Pre-existing | 9.4.0 |
|
|
391
|
+
| `cancelTriggerNotifications()` / `createTriggerNotification()` promises resolve before Room DB write completes, causing ~3% race on cancel-then-create patterns. Also fixes a previously-undocumented reboot-recovery data-loss bug in `NotifeeAlarmManager.rescheduleNotification` and an ordering bug in `NotificationManager.doScheduledWork` | Android | [#549](https://github.com/invertase/notifee/issues/549) | 9.5.0 |
|
|
392
|
+
| Scheduled trigger notifications silently lost across device reboot on OEM devices (Xiaomi MIUI, OnePlus, Huawei EMUI, Oppo ColorOS, Vivo FuntouchOS) whose vendor OS suppresses `BOOT_COMPLETED` until the user manually enables autostart. Also handles zombie non-repeating triggers whose fire time already passed (fire-once within a 24-hour grace period, then delete the Room row; delete silently beyond the grace period) and adds try/catch/finally guards to all notifee `BroadcastReceiver` async paths. | Android | [#734](https://github.com/invertase/notifee/issues/734) | 9.6.0 |
|
|
393
|
+
| `RepeatFrequency.DAILY` / `WEEKLY` triggers fire on day 1 but never on day 2+ (also reproduces with arrays of 24 daily reminders) — pre-fix: stale Room anchors after the post-fire repeat recalculation, plus DST ±1h shift on repeating triggers, plus reboot recovery silently dropping the rearmed PendingIntent on OEM devices that suppress `BOOT_COMPLETED` | Android | [#601](https://github.com/invertase/notifee/issues/601), [#1063](https://github.com/invertase/notifee/issues/1063) | 9.1.14 (DST + persist recalc) + 9.5.0 (await Room) + 9.6.0 (BOOT_COUNT cold-start, race guard) |
|
|
394
|
+
| Scheduled `TIMESTAMP` trigger notifications lost after device reboot on Android 14 emulator with battery optimizations off — pre-fix: `RebootBroadcastReceiver` dropped the goAsync handoff before Room writes completed; OEM devices that suppress `BOOT_COMPLETED` never re-armed the alarm at all | Android | [#991](https://github.com/invertase/notifee/issues/991) | 9.1.12 (goAsync in `RebootBroadcastReceiver`) + 9.5.0 (await Room in `rescheduleNotification`) + 9.6.0 (BOOT_COUNT cold-start for OEM suppressors) |
|
|
395
|
+
| `ObjectAlreadyConsumedException` in headless task when the same `WritableMap` is reused or the `taskConfig` accessor is read twice — `TaskConfig.init` mutated the caller's map instead of copying it first. Latent in most apps but observed in production by upstream users with high-frequency headless events | Android | [#266](https://github.com/invertase/notifee/issues/266) | 9.6.0 |
|
|
396
|
+
| `getDisplayedNotifications()` returned no `data` field on Android, breaking iOS/Android API symmetry where iOS exposes custom keys via `parseDataFromUserInfo:` (see platform limitation note below — the fix is API parity for app-posted notifications, not a workaround for FCM background auto-display) | Android | [#393](https://github.com/invertase/notifee/issues/393) | 9.7.0 |
|
|
397
|
+
| Small icon resolution failure in release builds causes `IllegalArgumentException` at `NotificationCompat.Builder.build()` — library now falls back to the app launcher icon and logs a warning instead of failing the notification display | Android | [#733](https://github.com/invertase/notifee/issues/733) | 10.1.0 |
|
|
379
398
|
|
|
380
399
|
> **Important note on `getDisplayedNotifications()` and FCM custom data on Android.**
|
|
381
400
|
>
|
|
@@ -402,11 +421,11 @@ As bugs are fixed, this table is updated. See [CHANGELOG.md](CHANGELOG.md) for f
|
|
|
402
421
|
|
|
403
422
|
Some upstream Notifee issues are not bugs in the library itself but platform-level limitations imposed by Android's Doze mode and vendor power management — no library code can make `AlarmManager` deliver an alarm to, or a foreground service survive inside, an app the OEM has explicitly paused. For these, the fork provides **documented mitigations**: user-facing helper APIs, code-level self-healing where possible, and decision guides that steer consumers toward the Android primitive most resilient to the specific vendor policy.
|
|
404
423
|
|
|
405
|
-
| Upstream issue
|
|
406
|
-
|
|
|
407
|
-
| [invertase/notifee#410](https://github.com/invertase/notifee/issues/410) | Foreground service paused on screen lock (Samsung OneUI, ~6 seconds after screen off on battery) and killed immediately when the app is backgrounded (Xiaomi MIUI)
|
|
408
|
-
| [invertase/notifee#734](https://github.com/invertase/notifee/issues/734) | Scheduled trigger notifications silently lost across a device reboot on OEM devices (Xiaomi MIUI, OnePlus, Huawei EMUI, Oppo ColorOS, Vivo FuntouchOS)
|
|
409
|
-
| [invertase/notifee#927](https://github.com/invertase/notifee/issues/927) | Custom sound passed via `displayNotification({ android: { sound, channelId }, ios: { sound } })` is ignored for **remote push notifications** (FCM/APNs) delivered while the app is in background or killed — the system default sound plays instead. Foreground delivery and **locally-scheduled notifications** (`displayNotification`, `createTriggerNotification`) are unaffected. | When a remote push arrives while the app is killed, the JavaScript layer never runs — the system tray item is drawn by the OS (Android system + Firebase SDK; iOS + APNs) before any Notifee code executes. On Android API 26+, the `NotificationChannel` sound is set once at channel creation and is immutable thereafter — `NotificationCompat.Builder.setSound()` is silently ignored when the builder has a `channelId`. On iOS, the Notification Service Extension only rewrites incoming push content when the payload contains a `notifee_options` key (see `NotifeeCoreExtensionHelper.m:43`); a plain APNs payload is delivered unmodified. | **Documentation only — the platform contract cannot be worked around at the library layer.** Recipes by platform: **(Android)** create the `NotificationChannel` with the desired sound at first-run (the channel sound is immutable; to change it the channel must be deleted and recreated under a new `channelId`), and configure `AndroidNotification.sound` in the FCM payload server-side so the system tray honors it for background pushes. As a heavier alternative, switch the backend to an FCM data-only payload and call `displayNotification()` from a headless task — the JS-side `android.sound` is then honored, but this trades simplicity for the cost of running JS on every push. **(iOS)** either set `aps.sound` directly in the APNs payload, or install the Notification Service Extension (see `docs/react-native/ios/remote-notification-support.mdx`) and ship the sound under `notifee_options.ios.sound` in the push payload.
|
|
424
|
+
| Upstream issue | Symptom | Platform root cause | Fork mitigation |
|
|
425
|
+
| ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
426
|
+
| [invertase/notifee#410](https://github.com/invertase/notifee/issues/410) | Foreground service paused on screen lock (Samsung OneUI, ~6 seconds after screen off on battery) and killed immediately when the app is backgrounded (Xiaomi MIUI) | Vendor aggressive battery-saver and autostart policies suspend or terminate foreground services of apps not whitelisted in the OEM's protected-apps / autostart settings. Partially Doze-related on non-exempt `foregroundServiceType` values; mostly OEM-specific behavior catalogued at [dontkillmyapp.com](https://dontkillmyapp.com/). | **(1) Decision guide** — the [Timers: foreground service or `SET_ALARM_CLOCK`?](#timers-foreground-service-or-set_alarm_clock) section recommends the `SET_ALARM_CLOCK` trigger over a silent foreground service for rest, cooking, and recovery timer use cases. `setAlarmClock` is the same primitive the stock Clock app uses and is generally respected by vendor aggressive-kill policies. **(2) Foreground service use case matrix** — the [Foreground service use case guide](#foreground-service-use-case-guide) documents which `foregroundServiceType` values are Doze-CPU-exempt, which have type-specific timeouts, and the Google Play policy constraints that rule out misusing `mediaPlayback` for silent timers. **(3) `openPowerManagerSettings()` helper API** — deep-links the user to the correct vendor autostart / protected-apps screen on 16 manufacturers; whitelisting the app prevents both `BOOT_COMPLETED` suppression and background FGS kills. |
|
|
427
|
+
| [invertase/notifee#734](https://github.com/invertase/notifee/issues/734) | Scheduled trigger notifications silently lost across a device reboot on OEM devices (Xiaomi MIUI, OnePlus, Huawei EMUI, Oppo ColorOS, Vivo FuntouchOS) | The vendor OS suppresses the `BOOT_COMPLETED` broadcast to apps the user has not manually whitelisted, so the library's `RebootBroadcastReceiver` never runs and persisted `AlarmManager` triggers are never re-armed after reboot. | **(1) `BOOT_COUNT` cold-start self-heal (code)** — on every app init, `InitProvider` compares `Settings.Global.BOOT_COUNT` against the last-known value in `SharedPreferences` and re-arms every persisted trigger on a background thread if a boot delta is detected, even when `BOOT_COMPLETED` was never delivered. Paired with a process-wide `AtomicBoolean` race guard in `NotifeeAlarmManager.rescheduleNotifications` that prevents double-advancement when the reboot receiver and the cold-start path race. **(2) `openPowerManagerSettings()` helper API** — the same vendor-settings deep-link used by #410, pointing the user at the autostart whitelist for defense in depth. |
|
|
428
|
+
| [invertase/notifee#927](https://github.com/invertase/notifee/issues/927) | Custom sound passed via `displayNotification({ android: { sound, channelId }, ios: { sound } })` is ignored for **remote push notifications** (FCM/APNs) delivered while the app is in background or killed — the system default sound plays instead. Foreground delivery and **locally-scheduled notifications** (`displayNotification`, `createTriggerNotification`) are unaffected. | When a remote push arrives while the app is killed, the JavaScript layer never runs — the system tray item is drawn by the OS (Android system + Firebase SDK; iOS + APNs) before any Notifee code executes. On Android API 26+, the `NotificationChannel` sound is set once at channel creation and is immutable thereafter — `NotificationCompat.Builder.setSound()` is silently ignored when the builder has a `channelId`. On iOS, the Notification Service Extension only rewrites incoming push content when the payload contains a `notifee_options` key (see `NotifeeCoreExtensionHelper.m:43`); a plain APNs payload is delivered unmodified. | **Documentation only — the platform contract cannot be worked around at the library layer.** Recipes by platform: **(Android)** create the `NotificationChannel` with the desired sound at first-run (the channel sound is immutable; to change it the channel must be deleted and recreated under a new `channelId`), and configure `AndroidNotification.sound` in the FCM payload server-side so the system tray honors it for background pushes. As a heavier alternative, switch the backend to an FCM data-only payload and call `displayNotification()` from a headless task — the JS-side `android.sound` is then honored, but this trades simplicity for the cost of running JS on every push. **(iOS)** either set `aps.sound` directly in the APNs payload, or install the Notification Service Extension (see `docs/react-native/ios/remote-notification-support.mdx`) and ship the sound under `notifee_options.ios.sound` in the push payload. |
|
|
410
429
|
|
|
411
430
|
Both mitigations are intentionally additive to the existing reboot-recovery and foreground-service code paths and do not replace the consumer's responsibility to prompt the user for battery-optimization exemption when the use case warrants it. For a complete vendor-by-vendor reference of autostart, battery-saver, and background-restriction behavior, see [dontkillmyapp.com](https://dontkillmyapp.com/).
|
|
412
431
|
|
|
@@ -432,6 +451,8 @@ In addition to bug fixes, the fork makes a few opinionated default changes vs `@
|
|
|
432
451
|
|
|
433
452
|
- **iOS `EventType.DELIVERED` now emitted for all foreground notifications** (since 9.3.0 — **BREAKING vs upstream**). Upstream Notifee had a guard in `willPresentNotification:` that suppressed DELIVERED for notifications created via `displayNotification()` (immediate display), emitting it only for trigger notifications. Android always emitted DELIVERED in both cases. The fork removes the guard so iOS matches Android. If you registered `onForegroundEvent` listeners that did heavy work on DELIVERED assuming the event would only fire for trigger notifications, audit them — you may now receive an event per `displayNotification()` call while in foreground. **Known limitation**: trigger notifications that fire while the app is in background or killed still do not emit DELIVERED on iOS — this is a platform limitation (`willPresentNotification:` is only invoked in foreground, and iOS provides no delegate callback for background-delivered triggers). If you need delivery confirmation for background trigger notifications on iOS, check the notification's presence via `getDisplayedNotifications()` after the app returns to foreground.
|
|
434
453
|
|
|
454
|
+
- **Failed `smallIcon` resolution falls back to the app launcher icon instead of failing the notification** (since 10.1.0). Previously, when the string in `android.smallIcon` did not resolve to a valid resource ID at runtime (asset only in `src/debug/res/`, R8 resource shrinking, naming mismatch), the library logged the failure at DEBUG level — invisible in release logcat — and skipped `setSmallIcon()`, causing `NotificationCompat.Builder.build()` to throw `IllegalArgumentException`. The library now resolves to the app's launcher icon as a fallback and logs a warning with the original icon name and likely causes. See the [Troubleshooting section](#small-icon-not-showing-in-android-release-builds-falls-back-to-launcher-icon) for diagnosis tips.
|
|
455
|
+
|
|
435
456
|
These changes are documented in the [CHANGELOG](CHANGELOG.md) under the release that introduced them. If you rely on any of the upstream defaults, you can either pin to the specific behavior via the opt-out flags listed above, or open an issue to discuss.
|
|
436
457
|
|
|
437
458
|
## Foreground Service Setup (Android 14+)
|
|
@@ -442,10 +463,12 @@ Android 14 (API 34) requires all foreground services to declare an explicit `for
|
|
|
442
463
|
|
|
443
464
|
```xml
|
|
444
465
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
445
|
-
<!-- Replace SHORT_SERVICE with the type matching your use case -->
|
|
446
|
-
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SHORT_SERVICE" />
|
|
447
466
|
```
|
|
448
467
|
|
|
468
|
+
Some foreground service types require a matching `FOREGROUND_SERVICE_*` permission. `shortService` does not use a
|
|
469
|
+
dedicated `FOREGROUND_SERVICE_SHORT_SERVICE` permission; keep `FOREGROUND_SERVICE`, declare the service type that
|
|
470
|
+
matches your use case, and add any real type-specific permissions required by the Android platform.
|
|
471
|
+
|
|
449
472
|
2. **Declare the service type on Notifee's ForegroundService:**
|
|
450
473
|
|
|
451
474
|
```xml
|
|
@@ -465,17 +488,17 @@ Available types: `camera`, `connectedDevice`, `dataSync`, `health`, `location`,
|
|
|
465
488
|
|
|
466
489
|
Choosing the right `foregroundServiceType` matters — the wrong choice can cause Doze-driven CPU suspension with the screen off, Google Play policy rejection, or premature kills by the Android 14+ type-specific timeouts. This matrix maps common use cases to the recommended type and calls out the caveats you need to know before shipping:
|
|
467
490
|
|
|
468
|
-
| Use case
|
|
469
|
-
|
|
|
470
|
-
| Silent rest / workout / cooking timer
|
|
471
|
-
| Timer with audio cue (metronome, guided set) | `mediaPlayback`
|
|
472
|
-
| Short operation (< 3 min)
|
|
473
|
-
| Long-running data sync
|
|
474
|
-
| Location / navigation / fitness GPS
|
|
475
|
-
| Music / podcast / audiobook playback
|
|
476
|
-
| Bluetooth / USB device sync
|
|
477
|
-
| Enterprise / DPC / system-critical
|
|
478
|
-
| Arbitrary deferrable background work
|
|
491
|
+
| Use case | Recommended type | Doze CPU exempt? | Type timeout | Key caveat |
|
|
492
|
+
| -------------------------------------------- | -------------------------------------------------- | ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
493
|
+
| Silent rest / workout / cooking timer | **`SET_ALARM_CLOCK` trigger — not an FGS** | N/A | N/A | See the ["Timers: foreground service or `SET_ALARM_CLOCK`?"](#timers-foreground-service-or-set_alarm_clock) decision guide below. |
|
|
494
|
+
| Timer with audio cue (metronome, guided set) | `mediaPlayback` | Yes | None | Must actually play audio — silent `mediaPlayback` is a Play Store policy violation. |
|
|
495
|
+
| Short operation (< 3 min) | `shortService` | No | **3 min** | Library's `onTimeout()` stops cleanly and emits `TYPE_FG_TIMEOUT` to JS. |
|
|
496
|
+
| Long-running data sync | `dataSync` | No | 6 h (API 34); stricter on API 35+ | Pair with `openBatteryOptimizationSettings()` for reliability on OEM devices. |
|
|
497
|
+
| Location / navigation / fitness GPS | `location` | Yes | None | Requires `ACCESS_FINE_LOCATION` runtime permission. |
|
|
498
|
+
| Music / podcast / audiobook playback | `mediaPlayback` | Yes | None | Must be real playback — see policy callout below. |
|
|
499
|
+
| Bluetooth / USB device sync | `connectedDevice` | No | None | Requires companion-device or Bluetooth permission. |
|
|
500
|
+
| Enterprise / DPC / system-critical | `specialUse` or `systemExempted` | Varies | None | `specialUse` requires a `<property>` element and Play Store justification review. |
|
|
501
|
+
| Arbitrary deferrable background work | **None — use `WorkManager` directly, not an FGS.** | N/A | N/A | FGS is not the right abstraction for deferrable work. |
|
|
479
502
|
|
|
480
503
|
> **Warning:** **`mediaPlayback` requires active audio playback.** [Google Play's Foreground Service Types policy](https://support.google.com/googleplay/android-developer/answer/13392821) explicitly prohibits declaring `mediaPlayback` for services that do not play audio. A silent timer, stopwatch, or rest-timer declared as `mediaPlayback` will be rejected during Play Store review. For silent long-running timers, prefer the `SET_ALARM_CLOCK` trigger path (see the decision guide below).
|
|
481
504
|
|
|
@@ -532,9 +555,9 @@ if (Platform.OS === 'android') {
|
|
|
532
555
|
|
|
533
556
|
For the authoritative vendor-by-vendor matrix of autostart, battery optimization, and background-restriction behavior, see [dontkillmyapp.com](https://dontkillmyapp.com/).
|
|
534
557
|
|
|
535
|
-
> **Scope note:** the cold-start recovery path is best-effort. It runs as soon as Android invokes `InitProvider.onCreate` (before `Application.onCreate`), but may still be delayed by minutes or hours on a device where the user never opens your app after a reboot. For use cases that require guaranteed sub-second timing (alarm clocks,
|
|
558
|
+
> **Scope note:** the cold-start recovery path is best-effort. It runs as soon as Android invokes `InitProvider.onCreate` (before `Application.onCreate`), but may still be delayed by minutes or hours on a device where the user never opens your app after a reboot. For use cases that require guaranteed sub-second timing (alarm clocks, time-sensitive reminders, calendar events), also declare `USE_EXACT_ALARM` in your manifest (see the [note above](#bugs-fixed-from-upstream-notifee)) and prompt the user to whitelist your app via the vendor settings helper.
|
|
536
559
|
>
|
|
537
|
-
> **Defense in depth:** the cold-start BOOT_COUNT path and the traditional `RebootBroadcastReceiver` path both funnel into the same `NotifeeAlarmManager.rescheduleNotifications` entry point, which is guarded by a process-wide `AtomicBoolean` — whichever path runs first wins the reschedule cycle, and the second logs `Reschedule already in progress, skipping duplicate request` and exits cleanly. On real devices the two paths often
|
|
560
|
+
> **Defense in depth:** the cold-start `BOOT_COUNT` path and the traditional `RebootBroadcastReceiver` path both funnel into the same `NotifeeAlarmManager.rescheduleNotifications` entry point, which is guarded by a process-wide `AtomicBoolean` — whichever path runs first wins the reschedule cycle, and the second logs `Reschedule already in progress, skipping duplicate request` and exits cleanly. On real devices the two paths often _both_ fire, for a subtle reason observed during Step 6 smoke testing: when the system force-stops your app (during an install, crash recovery, or a `pm clear` from a QA tool) and then Android re-delivers `BOOT_COMPLETED` as soon as the package is launched again, the reboot receiver runs at the same time as `InitProvider.onCreate`'s cold-start check. You get both paths for free — proof of the race guard's design. On an OEM device that suppresses `BOOT_COMPLETED` outright, only the cold-start path runs. Either way the zombie re-fire loop is broken.
|
|
538
561
|
|
|
539
562
|
### Trigger Notification Reliability
|
|
540
563
|
|
|
@@ -564,13 +587,13 @@ five `AlarmType` values — including `SET_ALARM_CLOCK`, which upstream Notifee
|
|
|
564
587
|
[invertase/notifee#655](https://github.com/invertase/notifee/issues/655) and merged via
|
|
565
588
|
[#749](https://github.com/invertase/notifee/pull/749).
|
|
566
589
|
|
|
567
|
-
| AlarmType
|
|
568
|
-
|
|
|
569
|
-
| `SET`
|
|
570
|
-
| `SET_AND_ALLOW_WHILE_IDLE`
|
|
571
|
-
| `SET_EXACT`
|
|
572
|
-
| `SET_EXACT_AND_ALLOW_WHILE_IDLE`
|
|
573
|
-
| `SET_ALARM_CLOCK`
|
|
590
|
+
| AlarmType | Exact? | Wakes device? | Doze bypass? | Status bar icon | When to use |
|
|
591
|
+
| -------------------------------- | ------ | ------------- | ------------ | --------------- | ------------------------------------------------------------------------------ |
|
|
592
|
+
| `SET` | No | Yes | No | No | Non-critical reminders that can slip by several minutes (daily digest). |
|
|
593
|
+
| `SET_AND_ALLOW_WHILE_IDLE` | No | Yes | Yes | No | Non-critical reminders that must still fire while the device is in Doze. |
|
|
594
|
+
| `SET_EXACT` | Yes | Yes | No | No | Time-sensitive reminders when the app is reasonably sure not to be in Doze. |
|
|
595
|
+
| `SET_EXACT_AND_ALLOW_WHILE_IDLE` | Yes | Yes | Yes | No | **Fork default.** Time-sensitive reminders that must fire even in Doze. |
|
|
596
|
+
| `SET_ALARM_CLOCK` | Yes | Yes | Yes | **Yes** | True alarm-clock / recovery-timer use cases — highest priority, OEM-resilient. |
|
|
574
597
|
|
|
575
598
|
`SET_ALARM_CLOCK` is the strongest Android guarantee available for a scheduled notification:
|
|
576
599
|
|
|
@@ -582,7 +605,7 @@ five `AlarmType` values — including `SET_ALARM_CLOCK`, which upstream Notifee
|
|
|
582
605
|
`setAlarmClock` even when they would otherwise drop `setExactAndAllowWhileIdle`. This is the
|
|
583
606
|
same mechanism the stock Clock app uses.
|
|
584
607
|
- **Intended for the same reliability problem as [invertase/notifee#734](https://github.com/invertase/notifee/issues/734).**
|
|
585
|
-
If your use case is a
|
|
608
|
+
If your use case is a time-sensitive reminder, a rest-timer between gym sets, a cooking timer,
|
|
586
609
|
or any recovery-timer scenario where a missed notification is user-visible damage, prefer
|
|
587
610
|
`SET_ALARM_CLOCK` over the fork default.
|
|
588
611
|
|
|
@@ -616,13 +639,13 @@ and consider prompting the user with `openAlarmPermissionSettings()`.
|
|
|
616
639
|
|
|
617
640
|
A common question for this fork: **should a rest / cooking / recovery timer be a foreground service, or a scheduled trigger notification?** For most timer use cases the answer is the trigger path — and specifically `SET_ALARM_CLOCK`.
|
|
618
641
|
|
|
619
|
-
| Timer characteristic
|
|
620
|
-
|
|
|
621
|
-
| Fires once at a known time, no live UI update while app is backgrounded | **`SET_ALARM_CLOCK` trigger** (see [AlarmType guide](#alarmtype-guide))
|
|
622
|
-
| Fires repeatedly at known intervals
|
|
623
|
-
| Needs a live ticking notification UI while app is backgrounded
|
|
624
|
-
| Streams audio, music, or guided voice
|
|
625
|
-
| Continuous background work (location, Bluetooth)
|
|
642
|
+
| Timer characteristic | Recommended approach |
|
|
643
|
+
| ----------------------------------------------------------------------- | -------------------------------------------------------------------------- |
|
|
644
|
+
| Fires once at a known time, no live UI update while app is backgrounded | **`SET_ALARM_CLOCK` trigger** (see [AlarmType guide](#alarmtype-guide)) |
|
|
645
|
+
| Fires repeatedly at known intervals | **`SET_ALARM_CLOCK` trigger** with app-side scheduling of the next cycle |
|
|
646
|
+
| Needs a live ticking notification UI while app is backgrounded | Foreground service (`mediaPlayback` if audio, otherwise reconsider the UX) |
|
|
647
|
+
| Streams audio, music, or guided voice | Foreground service with `mediaPlayback` |
|
|
648
|
+
| Continuous background work (location, Bluetooth) | Foreground service with the matching type from the matrix above |
|
|
626
649
|
|
|
627
650
|
**Why `SET_ALARM_CLOCK` is usually the right choice for timers:**
|
|
628
651
|
|
|
@@ -631,7 +654,7 @@ A common question for this fork: **should a rest / cooking / recovery timer be a
|
|
|
631
654
|
- **No risk of Play Store rejection** for misusing `mediaPlayback` on a silent timer.
|
|
632
655
|
- **No wake lock to manage.** The library's foreground-service path does not acquire a wake lock on your behalf — under Doze on a non-exempt `foregroundServiceType`, the CPU can still suspend with the screen off. `SET_ALARM_CLOCK` wakes the device at fire time regardless of Doze state.
|
|
633
656
|
|
|
634
|
-
**When a foreground service
|
|
657
|
+
**When a foreground service _is_ the right choice:**
|
|
635
658
|
|
|
636
659
|
- You need the notification to tick every second while the app is backgrounded (metronome with audio, VoIP call, active GPS track). A `SET_ALARM_CLOCK` trigger fires once at the scheduled time, not continuously.
|
|
637
660
|
- You need actual audio playback — use `mediaPlayback`.
|
|
@@ -696,6 +719,26 @@ Default is `true` (backward compatible — Notifee handles everything, same as o
|
|
|
696
719
|
|
|
697
720
|
### Troubleshooting
|
|
698
721
|
|
|
722
|
+
#### Small icon not showing in Android release builds (falls back to launcher icon)
|
|
723
|
+
|
|
724
|
+
From 10.1.0, when the resource ID for `android.smallIcon` cannot be resolved at runtime, the library logs a warning and falls back to your app's launcher icon instead of failing the notification display. If you see your launcher icon in a notification where you expected a custom small icon, filter logcat for the `NOTIFEE` tag to find the resolution failure.
|
|
725
|
+
|
|
726
|
+
Three causes account for the vast majority of reports:
|
|
727
|
+
|
|
728
|
+
**Asset only in `src/debug/res/`.** When you add a drawable from Android Studio with the "Image Asset" wizard, the IDE sometimes places it under the `debug` variant only. The resource exists in debug builds but disappears in release. Copy or move the asset into `android/app/src/main/res/drawable-*/` (and the density buckets) so it participates in the release build.
|
|
729
|
+
|
|
730
|
+
**R8 / ProGuard resource shrinking.** Release builds with `shrinkResources true` in the app's `build.gradle` can strip drawables that R8 judges unreferenced from code. Declare the asset as keep in `android/app/src/main/res/raw/keep.xml`:
|
|
731
|
+
|
|
732
|
+
```xml
|
|
733
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
734
|
+
<resources xmlns:tools="http://schemas.android.com/tools"
|
|
735
|
+
tools:keep="@drawable/ic_notification" />
|
|
736
|
+
```
|
|
737
|
+
|
|
738
|
+
**Naming mismatch.** Android resource names are case-sensitive and only accept `[a-z0-9_]`. A string like `smallIcon: 'icNotification'` will not resolve `ic_notification.png`. Rename the `smallIcon` value to match the file on disk exactly.
|
|
739
|
+
|
|
740
|
+
For the full procedure on creating a small-icon asset via Android Studio, see [docs/react-native/android/appearance.mdx](docs/react-native/android/appearance.mdx).
|
|
741
|
+
|
|
699
742
|
#### Custom sounds for push notifications in background or killed state
|
|
700
743
|
|
|
701
744
|
If you've set `android.sound` and `ios.sound` in `displayNotification(...)` and the custom sound plays only when the app is in foreground, this is expected platform behavior — not a library bug. When a **remote push** (FCM/APNs) arrives while the app is killed, your JavaScript code never runs, so anything you configured client-side is ignored.
|
|
@@ -707,10 +750,35 @@ The fix is to set the sound in the push payload **server-side**:
|
|
|
707
750
|
|
|
708
751
|
An advanced alternative on Android is to switch the backend to an FCM **data-only** payload and call `notifee.displayNotification()` from a headless task — this lets the JS-side `android.sound` win, at the cost of running JS on every push. Most apps should prefer the server-side payload approach.
|
|
709
752
|
|
|
710
|
-
**Local notifications are different.** This limitation only affects **remote pushes** delivered by FCM/APNs while the app is killed. Notifications scheduled locally via `notifee.displayNotification()` or `notifee.createTriggerNotification()` — for example, a timer firing after the user closed the app —
|
|
753
|
+
**Local notifications are different.** This limitation only affects **remote pushes** delivered by FCM/APNs while the app is killed. Notifications scheduled locally via `notifee.displayNotification()` or `notifee.createTriggerNotification()` — for example, a timer firing after the user closed the app — _do_ honor the JS-side `sound` parameter, because the library itself wakes up and presents the notification (via `AlarmManager` on Android or `UNUserNotificationCenter` on iOS). The usual platform rules still apply: on Android the `NotificationChannel` sound is immutable after creation and wins over the per-notification `sound`; on iOS the sound file must be bundled in the app (`.wav`/`.aiff`/`.caf`, under 30 seconds, in the main bundle). For reliable local timer notifications on OEM devices that aggressively kill background work, prefer `AlarmType.SET_ALARM_CLOCK` — see the [Timers: foreground service or `SET_ALARM_CLOCK`?](#timers-foreground-service-or-set_alarm_clock) section.
|
|
711
754
|
|
|
712
755
|
Reference: [invertase/notifee#927](https://github.com/invertase/notifee/issues/927).
|
|
713
756
|
|
|
757
|
+
#### Silent pushes and background fetch — handled by Firebase, not by this library
|
|
758
|
+
|
|
759
|
+
`react-native-notify-kit` hooks into `UNUserNotificationCenterDelegate` on iOS to display notifications and dispatch tap/delivery events to JS. It does **not** hook into `application:didReceiveRemoteNotification:fetchCompletionHandler:` — the iOS entry point for silent pushes (`content-available: 1` with no visible alert) and background fetch. Those paths belong to [`@react-native-firebase/messaging`](https://rnfirebase.io/messaging/usage) via `setBackgroundMessageHandler`.
|
|
760
|
+
|
|
761
|
+
If a silent push arrives while the app is killed and its only job is to trigger JS code (no notification displayed), subject to iOS's background budget it is handled entirely by Firebase's path — `notifee.onBackgroundEvent` will not fire, by design. If the silent push's JS handler then calls `notifee.displayNotification()`, the subsequent user tap on the displayed notification does flow through Notifee and fires `onBackgroundEvent` normally.
|
|
762
|
+
|
|
763
|
+
Relates to upstream [invertase/notifee#597](https://github.com/invertase/notifee/issues/597) for apps with slow startup. For remote notifications that should fire `onBackgroundEvent` reliably on iOS, use [FCM Mode](docs/fcm-mode.mdx) — see also the note on [#1133](https://github.com/invertase/notifee/issues/1133) in the FCM Mode guide.
|
|
764
|
+
|
|
765
|
+
#### `Could not resolve app.notifee:core:+` — does not apply to this fork
|
|
766
|
+
|
|
767
|
+
If you arrived here from a Google search for this error, note: the error is specific
|
|
768
|
+
to `@notifee/react-native` (the archived upstream package), where the native core was
|
|
769
|
+
distributed as a pre-compiled AAR inside a bundled Maven repo at
|
|
770
|
+
`node_modules/@notifee/react-native/android/libs/`. The fork eliminated that
|
|
771
|
+
distribution model in 9.2.0 — the core compiles from source as part of the bridge
|
|
772
|
+
module, so there is no Maven coordinate to resolve, no `extraMavenRepos` to configure
|
|
773
|
+
on Expo, and no `FAIL_ON_PROJECT_REPOS` conflict on RN 0.74+. Migrating from
|
|
774
|
+
`@notifee/react-native` to `react-native-notify-kit` removes the error with no
|
|
775
|
+
additional `build.gradle` patching, no config plugin, and no Expo `extraMavenRepos`
|
|
776
|
+
entry.
|
|
777
|
+
|
|
778
|
+
References: upstream issues [#1079](https://github.com/invertase/notifee/issues/1079),
|
|
779
|
+
[#1226](https://github.com/invertase/notifee/issues/1226),
|
|
780
|
+
[#1262](https://github.com/invertase/notifee/issues/1262).
|
|
781
|
+
|
|
714
782
|
### Manual warmup control
|
|
715
783
|
|
|
716
784
|
The library automatically pre-warms the foreground service notification path during app startup via `InitProvider`. **Most apps do not need to do anything extra.** However, in certain edge cases the automatic warmup may not be sufficient:
|
|
@@ -766,31 +834,31 @@ The full `react-native-notify-kit` documentation is hosted on docs.page and is k
|
|
|
766
834
|
|
|
767
835
|
The APIs for Android allow for creating rich, styled and highly interactive notifications. Below you'll find guides that cover the supported Android features.
|
|
768
836
|
|
|
769
|
-
| Topic
|
|
770
|
-
|
|
|
771
|
-
| [Appearance](https://docs.page/marcocrupi/react-native-notify-kit/react-native/android/appearance)
|
|
772
|
-
| [Behaviour](https://docs.page/marcocrupi/react-native-notify-kit/react-native/android/behaviour)
|
|
773
|
-
| [Channels & Groups](https://docs.page/marcocrupi/react-native-notify-kit/react-native/android/channels)
|
|
774
|
-
| [Foreground Service](https://docs.page/marcocrupi/react-native-notify-kit/react-native/android/foreground-service)
|
|
775
|
-
| [Grouping & Sorting](https://docs.page/marcocrupi/react-native-notify-kit/react-native/android/grouping-and-sorting) | Group and sort related notifications in a single notification pane.
|
|
776
|
-
| [Interaction](https://docs.page/marcocrupi/react-native-notify-kit/react-native/android/interaction)
|
|
777
|
-
| [Progress Indicators](https://docs.page/marcocrupi/react-native-notify-kit/react-native/android/progress-indicators) | Show users a progress indicator of an on-going background task, and learn how to keep it updated.
|
|
778
|
-
| [Styles](https://docs.page/marcocrupi/react-native-notify-kit/react-native/android/styles)
|
|
779
|
-
| [Timers](https://docs.page/marcocrupi/react-native-notify-kit/react-native/android/timers)
|
|
837
|
+
| Topic | |
|
|
838
|
+
| -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
839
|
+
| [Appearance](https://docs.page/marcocrupi/react-native-notify-kit/react-native/android/appearance) | Change the appearance of a notification; icons, colors, visibility etc. |
|
|
840
|
+
| [Behaviour](https://docs.page/marcocrupi/react-native-notify-kit/react-native/android/behaviour) | Customize how a notification behaves when it is delivered to a device; sound, vibration, lights etc. |
|
|
841
|
+
| [Channels & Groups](https://docs.page/marcocrupi/react-native-notify-kit/react-native/android/channels) | Organize your notifications into channels & groups to allow users to control how notifications are handled on their device. |
|
|
842
|
+
| [Foreground Service](https://docs.page/marcocrupi/react-native-notify-kit/react-native/android/foreground-service) | Long running background tasks can take advantage of an Android Foreground Service to display an on-going, prominent notification. |
|
|
843
|
+
| [Grouping & Sorting](https://docs.page/marcocrupi/react-native-notify-kit/react-native/android/grouping-and-sorting) | Group and sort related notifications in a single notification pane. |
|
|
844
|
+
| [Interaction](https://docs.page/marcocrupi/react-native-notify-kit/react-native/android/interaction) | Allow users to interact with your application directly from the notification, with actions. |
|
|
845
|
+
| [Progress Indicators](https://docs.page/marcocrupi/react-native-notify-kit/react-native/android/progress-indicators) | Show users a progress indicator of an on-going background task, and learn how to keep it updated. |
|
|
846
|
+
| [Styles](https://docs.page/marcocrupi/react-native-notify-kit/react-native/android/styles) | Style notifications to show richer content, such as expandable images/text, or message conversations. |
|
|
847
|
+
| [Timers](https://docs.page/marcocrupi/react-native-notify-kit/react-native/android/timers) | Display counting timers on your notification, useful for on-going tasks such as a phone call, or event time remaining. |
|
|
780
848
|
|
|
781
849
|
### iOS
|
|
782
850
|
|
|
783
851
|
Below you'll find guides that cover the supported iOS features.
|
|
784
852
|
|
|
785
|
-
| Topic
|
|
786
|
-
|
|
|
787
|
-
| [Appearance](https://docs.page/marcocrupi/react-native-notify-kit/react-native/ios/appearance)
|
|
788
|
-
| [Badges](https://docs.page/marcocrupi/react-native-notify-kit/react-native/ios/badges)
|
|
789
|
-
| [Behaviour](https://docs.page/marcocrupi/react-native-notify-kit/react-native/ios/behaviour)
|
|
790
|
-
| [Categories](https://docs.page/marcocrupi/react-native-notify-kit/react-native/ios/categories)
|
|
791
|
-
| [Interaction](https://docs.page/marcocrupi/react-native-notify-kit/react-native/ios/interaction)
|
|
792
|
-
| [Permissions](https://docs.page/marcocrupi/react-native-notify-kit/react-native/ios/permissions)
|
|
793
|
-
| [Remote Notification Support](https://docs.page/marcocrupi/react-native-notify-kit/react-native/ios/remote-notification-support) | Handle and display remote notifications with Notification Service Extension.
|
|
853
|
+
| Topic | |
|
|
854
|
+
| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
|
855
|
+
| [Appearance](https://docs.page/marcocrupi/react-native-notify-kit/react-native/ios/appearance) | Change how the notification is displayed to your users. |
|
|
856
|
+
| [Badges](https://docs.page/marcocrupi/react-native-notify-kit/react-native/ios/badges) | Manage the app icon badge count on iOS devices. |
|
|
857
|
+
| [Behaviour](https://docs.page/marcocrupi/react-native-notify-kit/react-native/ios/behaviour) | Control how notifications behave when they are displayed on a device; sound, critical alerts, etc. |
|
|
858
|
+
| [Categories](https://docs.page/marcocrupi/react-native-notify-kit/react-native/ios/categories) | Create & assign categories to notifications. |
|
|
859
|
+
| [Interaction](https://docs.page/marcocrupi/react-native-notify-kit/react-native/ios/interaction) | Handle user interaction with your notifications. |
|
|
860
|
+
| [Permissions](https://docs.page/marcocrupi/react-native-notify-kit/react-native/ios/permissions) | Request permission from your application users to display notifications. |
|
|
861
|
+
| [Remote Notification Support](https://docs.page/marcocrupi/react-native-notify-kit/react-native/ios/remote-notification-support) | Handle and display remote notifications with Notification Service Extension. |
|
|
794
862
|
|
|
795
863
|
## Trademark Notice
|
|
796
864
|
|