react-native-notify-kit 9.1.12 → 9.1.13

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 CHANGED
@@ -206,14 +206,127 @@ transformIgnorePatterns: [
206
206
 
207
207
  ## What's Different from Notifee
208
208
 
209
- This fork fixes 9 upstream bugs and adds several improvements:
209
+ This fork is a complete migration to React Native's **New Architecture**:
210
+
211
+ - **TurboModules only** — no legacy Bridge support
212
+ - **Android bridge rewritten in Kotlin** (original was Java)
213
+ - **11 upstream bugs fixed** — see table below
214
+ - **Reliable trigger notifications** — AlarmManager is the default backend instead of WorkManager
215
+ - **New API: `setNotificationConfig()`** — opt-out flag for iOS remote notification handling
216
+
217
+ ## Bugs Fixed from Upstream Notifee
218
+
219
+ | Bug | Platform | Upstream Issue | Fixed in |
220
+ | --- | -------- | -------------- | -------- |
221
+ | Notifee intercepts iOS remote notification tap handlers, breaking RNFB `onNotificationOpenedApp` / `getInitialNotification` | iOS | [#912](https://github.com/invertase/notifee/issues/912) | 9.1.12 |
222
+ | `completionHandler` not called on notification dismiss | iOS | Pre-existing | 9.1.12 |
223
+ | `completionHandler` not called in `willPresentNotification` fallback | iOS | Pre-existing | 9.1.12 |
224
+ | `getInitialNotification()` returns `null` on cold start (deprecated `UIApplicationLaunchOptionsLocalNotificationKey` check) | iOS | [#1128](https://github.com/invertase/notifee/issues/1128) | 9.1.12 |
225
+ | `getInitialNotification()` returns `null` without `pressAction` configured | Android | [#1128](https://github.com/invertase/notifee/issues/1128) | 9.1.12 |
226
+ | Foreground press events silently dropped when React instance not ready | Android | [#1279](https://github.com/invertase/notifee/issues/1279) | 9.1.12 |
227
+ | 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 |
228
+ | `SCHEDULE_EXACT_ALARM` denial silently drops scheduled alarms (no fallback) | Android | [#1100](https://github.com/invertase/notifee/issues/1100) | 9.1.12 |
229
+ | `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 |
230
+ | 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 |
231
+ | Foreground service crashes with ANR after ~3 min on Android 14+ (`shortService` timeout, missing `onTimeout()`) | Android | [#703](https://github.com/invertase/notifee/issues/703) | 9.1.13 |
232
+ | Manifest merger failure when overriding `foregroundServiceType` on `ForegroundService` | Android | [#1108](https://github.com/invertase/notifee/issues/1108) | 9.1.13 |
233
+
234
+ > **Note for apps requiring guaranteed exact alarms (alarm clocks, timers, calendars):**
235
+ > Add `<uses-permission android:name="android.permission.USE_EXACT_ALARM" />` to your app's
236
+ > `AndroidManifest.xml`. This permission is auto-granted and not revocable, but Google Play
237
+ > restricts its use to apps whose core function requires exact timing.
238
+ > For all other apps, the library uses `SCHEDULE_EXACT_ALARM` with automatic fallback
239
+ > to inexact alarms when the permission is not granted.
240
+
241
+ See [CHANGELOG](https://github.com/marcocrupi/notifee/blob/main/CHANGELOG.md) for full details.
242
+
243
+ ## Foreground Service Setup (Android 14+)
244
+
245
+ Android 14 (API 34) requires all foreground services to declare an explicit `foregroundServiceType`. If you use `asForegroundService: true` in your notifications, add the following to your app's `AndroidManifest.xml`:
246
+
247
+ 1. **Add the required permissions:**
210
248
 
211
- - **Reliable trigger notifications** — AlarmManager is the default backend instead of WorkManager, ensuring delivery even when the app is killed
212
- - **iOS remote notification fix** — new `setNotificationConfig()` API to prevent Notifee from intercepting Firebase Messaging tap handlers ([#912](https://github.com/invertase/notifee/issues/912))
213
- - **Android alarm fixes** `goAsync()` in BroadcastReceivers, exact alarm fallback, Doze mode compatibility ([#1100](https://github.com/invertase/notifee/issues/1100), [#961](https://github.com/invertase/notifee/issues/961))
214
- - **Cold start fixes** — `getInitialNotification()` works correctly on both platforms ([#1128](https://github.com/invertase/notifee/issues/1128))
249
+ ```xml
250
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
251
+ <!-- Replace SHORT_SERVICE with the type matching your use case -->
252
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE_SHORT_SERVICE" />
253
+ ```
254
+
255
+ 2. **Declare the service type on Notifee's ForegroundService:**
256
+
257
+ ```xml
258
+ <application ...>
259
+ <service
260
+ android:name="app.notifee.core.ForegroundService"
261
+ android:exported="false"
262
+ android:foregroundServiceType="shortService" />
263
+ </application>
264
+ ```
265
+
266
+ Available types: `camera`, `connectedDevice`, `dataSync`, `health`, `location`, `mediaPlayback`, `mediaProjection`, `microphone`, `phoneCall`, `remoteMessaging`, `shortService`, `specialUse`, `systemExempted`. Choose the type that matches your use case — using the wrong type may cause Google Play policy violations.
267
+
268
+ > **Note:** `shortService` has a 3-minute timeout on Android 14+. If your foreground service needs to run longer, use a different type. The library's `onTimeout()` handler will gracefully stop the service if the timeout fires.
269
+
270
+ ## Trigger Notification Reliability
271
+
272
+ This fork defaults to AlarmManager for trigger notifications on Android, instead of WorkManager.
273
+ This ensures scheduled notifications are delivered reliably even when the app is killed.
274
+
275
+ The original Notifee used WorkManager by default, which is battery-friendly but unreliable
276
+ for time-sensitive notifications — Android may defer or drop WorkManager tasks based on
277
+ battery optimization, Doze mode, and OEM power management.
278
+
279
+ If you need battery-friendly scheduling where exact timing is not critical (e.g., daily digest
280
+ notifications), you can opt out:
281
+
282
+ ```typescript
283
+ await notifee.createTriggerNotification(notification, {
284
+ type: TriggerType.TIMESTAMP,
285
+ timestamp: Date.now() + 60000,
286
+ alarmManager: false, // Uses WorkManager instead
287
+ });
288
+ ```
289
+
290
+ ## New APIs
291
+
292
+ ### `setNotificationConfig` (iOS)
293
+
294
+ Controls whether Notifee intercepts remote (push) notification tap events on iOS.
295
+ When using React Native Firebase Messaging alongside Notifee, call this at app startup
296
+ to let Firebase handle remote notification taps:
297
+
298
+ ```typescript
299
+ import notifee from 'react-native-notify-kit';
300
+
301
+ await notifee.setNotificationConfig({
302
+ ios: { handleRemoteNotifications: false },
303
+ });
304
+ ```
305
+
306
+ With `handleRemoteNotifications: false`:
307
+
308
+ - Remote notifications (FCM) → handled by Firebase Messaging (`onNotificationOpenedApp`, `getInitialNotification`)
309
+ - Local Notifee notifications → still handled by Notifee (unchanged)
310
+
311
+ Default is `true` (backward compatible — Notifee handles everything, same as original Notifee behavior).
312
+
313
+ ### Android: `pressAction` required for tap handling
314
+
315
+ On Android, notifications require a `pressAction` to open the app when tapped:
316
+
317
+ ```typescript
318
+ await notifee.displayNotification({
319
+ title: 'Hello',
320
+ body: 'Tap to open',
321
+ android: {
322
+ channelId: 'default',
323
+ pressAction: { id: 'default', launchActivity: 'default' },
324
+ },
325
+ });
326
+ ```
215
327
 
216
- See the full [CHANGELOG](https://github.com/marcocrupi/notifee/blob/main/CHANGELOG.md) and [README](https://github.com/marcocrupi/notifee#bugs-fixed-from-upstream-notifee) for details.
328
+ Without `pressAction`, the notification will display but tapping it will do nothing.
329
+ This is Android platform behavior, not a bug. iOS opens the app by default on tap.
217
330
 
218
331
  ## Documentation
219
332
 
@@ -1 +1 @@
1
- 92a6444c2c6acb894f8114d257d642c2
1
+ 03be2bd9ea6f1abab7409b008a68b22f
@@ -1 +1 @@
1
- bcaf285f6e2974c8d8e7005bb6aae61e9da6e8b7
1
+ 3c5d3fba5a39e0379492ccebf595780f1ca4b2bb
@@ -1 +1 @@
1
- abdf2235b5decafa866c977614e1a684cd0184e3cc08af31f406e20ee44e4923
1
+ 0adbd7ca46edd01d54d884368b4009a6725d71d84cb1cc390d0d69824cf4f4d8
@@ -1 +1 @@
1
- 2c07293600a245e9f1366620f2745e6fda40e4bb77bec1fd262b0aa74fc7deecf1c6aa0ae7b56b1ca2a85e0bf1a46690be1619d4ed1d9bbaf59cd84c40413099
1
+ 47b1f9afbe975069248b988c23d5e693c7aed936016041e259c53180d29f37b8366d68c854f268bfc1b091e0bda4f47931d7814f092c0a9a37b76896e7017d3e
@@ -8,6 +8,6 @@
8
8
  <versions>
9
9
  <version>202108261754</version>
10
10
  </versions>
11
- <lastUpdated>20260405104736</lastUpdated>
11
+ <lastUpdated>20260405202849</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- c313005fb95a7f74adb2ab4a7d965a84
1
+ 642689e0ae7e377ba7c0b81eea65b251
@@ -1 +1 @@
1
- 0d0abfdcd79dd71d19a57ef2e11a6a9f15c5bfdf
1
+ 5cca9a43a4a3ec1ef1fea9eb4f7f539845698d6c
@@ -1 +1 @@
1
- bf0ca1fdb6cf65587d3a9c53b1bfdec388dfa3f54c13e5f10bd51d65aca40dad
1
+ 23cbe0485817c9c413e87c45aec0a27a770fd63942baca688b482f819bc97fb6
@@ -1 +1 @@
1
- ba064764bf62e099f544cdee6c6c0fe600b47c77284d82f3dbf14f2a9c87bfc9aed016d0cb05be1efc872bdaa8999fa3372710eb31bd4325e0ec0fffee5fb3be
1
+ 5794011b4c59116e983c15137b9a08db00585e3a0771d55af89e5abcca04a76770f83cc73fe30a3ca25bf4e23d8ea9e7834e86516b632c68994979c893b99062
@@ -45,6 +45,12 @@ class NotifeeEventSubscriber : EventListener {
45
45
  extras.getString(KEY_DETAIL_INPUT)?.let { input ->
46
46
  eventDetailMap.putString(KEY_DETAIL_INPUT, input)
47
47
  }
48
+ if (extras.containsKey("startId")) {
49
+ eventDetailMap.putInt("startId", extras.getInt("startId"))
50
+ }
51
+ if (extras.containsKey("fgsType")) {
52
+ eventDetailMap.putInt("fgsType", extras.getInt("fgsType"))
53
+ }
48
54
  }
49
55
 
50
56
  eventMap.putMap(KEY_DETAIL, eventDetailMap)
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "9.1.12";
1
+ export declare const version = "9.1.13";
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // Generated by genversion.
2
- export const version = '9.1.12';
2
+ export const version = '9.1.13';
3
3
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-notify-kit",
3
- "version": "9.1.12",
3
+ "version": "9.1.13",
4
4
  "author": "Marco Crupi",
5
5
  "description": "React Native Notify Kit - a feature rich notifications library for React Native.",
6
6
  "main": "dist/index.js",
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '9.1.12';
2
+ export const version = '9.1.13';