react-native-notify-kit 10.4.8 → 10.5.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 +5 -1
- package/android/src/main/kotlin/io/invertase/notifee/NotifeeReactUtils.kt +679 -7
- package/android/src/test/java/io/invertase/notifee/NotifeeReactUtilsPendingEventsTest.java +1025 -0
- package/dist/NotifeeApiModule.js +4 -0
- package/dist/NotifeeApiModule.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/server/README.md +6 -4
- package/server/dist/android.js +3 -3
- package/server/dist/android.js.map +1 -1
- package/server/src/android.ts +4 -4
- package/src/NotifeeApiModule.ts +5 -0
- package/src/internal/fcmContract.d.ts +10 -8
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -146,6 +146,8 @@ useEffect(() => {
|
|
|
146
146
|
}, []);
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
+
> **Android event reliability:** Registering `onForegroundEvent()` initializes the native event relay. Pending events received while the `ReactContext` is unavailable are buffered. If the context becomes unavailable after a flush takes its buffer snapshot, undelivered events are requeued so a later native event relay flush can deliver them without duplication in the validated recovery path, while preserving FIFO, the 10-event capacity, and drop-oldest behavior. No application code changes or warm-up calls such as `getDisplayedNotifications()` are required; continue registering foreground and background handlers at the recommended points shown above. This hardens the Android event path investigated in [react-native-notify-kit#47](https://github.com/marcocrupi/react-native-notify-kit/issues/47) and relates to the event reliability and buffering problem tracked in [invertase/notifee#1279](https://github.com/invertase/notifee/issues/1279); the scenarios are not necessarily identical.
|
|
150
|
+
|
|
149
151
|
> **Which handler fires when (iOS):**
|
|
150
152
|
>
|
|
151
153
|
> - Tap a notification while the app is **active in foreground** → `onForegroundEvent` receives `PRESS`.
|
|
@@ -375,7 +377,7 @@ For bare React Native projects with non-standard iOS paths or heavily-customized
|
|
|
375
377
|
|
|
376
378
|
## Server SDK
|
|
377
379
|
|
|
378
|
-
`react-native-notify-kit` ships a **zero-dependency server SDK** under the `/server` subpath
|
|
380
|
+
`react-native-notify-kit` ships a **zero-dependency server SDK** under the `/server` subpath for building Firebase Admin-compatible FCM messages that the client `handleFcmMessage` handler consumes. Firebase Admin serializes each message to the FCM HTTP v1 request format. The SDK runs in Node.js 22+ and Firebase Cloud Functions.
|
|
379
381
|
|
|
380
382
|
```ts
|
|
381
383
|
import { buildNotifyKitPayload } from 'react-native-notify-kit/server';
|
|
@@ -397,6 +399,8 @@ const message = buildNotifyKitPayload({
|
|
|
397
399
|
await admin.messaging().send(message);
|
|
398
400
|
```
|
|
399
401
|
|
|
402
|
+
`options.ttl` is expressed in seconds. Pass the message directly to Firebase Admin without an adapter or a manual unit conversion.
|
|
403
|
+
|
|
400
404
|
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).
|
|
401
405
|
|
|
402
406
|
## CLI Tools
|