Repository navigation
10.0.0
Added
-
CLI bin wiring:
npx react-native-notify-kit init-nsenow works out-of-the-box afternpm install react-native-notify-kit. CLI is prepacked into the main package at publish time. CLI deps (xcode,commander,chalk,plist) ship asoptionalDependencies. E2E tarball regression script validates the full consumer flow. Issue #129, Phase 4 of 4. -
CLI
init-nse:npx react-native-notify-kit init-nsescaffolds an iOS Notification Service Extension target, patching.pbxprojand Podfile automatically. Generates Swift +NotifyKitNSEtarget usingNotifeeExtensionHelperfor push enrichment. Supports--dry-run,--force,--target-name,--ios-pathoptions. Atomic writes with backup/restore on failure. Issue #129, Phase 3 of 4. -
Client FCM handler:
notifee.handleFcmMessage(remoteMessage)— one-liner client handler for FCM messages withnotifee_optionspayloads. Parses the server SDK's serialized blob, reconstructs aNotificationobject, and dispatches per platform: Android always displays (data-only), iOS foreground displays, iOS background/killed is a no-op (NSE handles it). Fallback path for non-NotifyKit payloads configurable viasetFcmConfig. Issue #129, Phase 2 of 4. -
Client FCM config:
notifee.setFcmConfig(config)— optional startup configuration forhandleFcmMessage. Covers:defaultChannelId,defaultPressAction,fallbackBehavior('display'or'ignore'), andios.suppressForegroundBanner. -
Server SDK: new
react-native-notify-kit/serversubpath export. A zero-runtime-dependency Node.js / Firebase Cloud Functions helper that builds FCM HTTP v1 message payloads ready foradmin.messaging().send(). Android messages are emitted data-only so the FCM SDK never auto-displays; iOS messages use alert-style APNs withmutable-content: 1so the Notification Service Extension always activates. Both platforms carry an identicalnotifee_optionsblob (_v: 1) that the upcoming Phase 2 client handler will consume. Issue #129, Phase 1 of 4.Public API:
buildNotifyKitPayload,buildIosApnsPayload,buildAndroidPayload,serializeNotifeeOptions, and allNotifyKit*types. Shared wire-contract types live in packages/react-native/src/internal/fcmContract.d.ts — an internal, non-public path that both the server SDK and the future client handler import from to stay in lock-step.Validation rejects: zero or multiple routing fields (
token/topic/condition), non-string values innotification.data, the reserved keysnotifee_options/notifee_datain user data, empty-stringnotification.id, non-integer or non-positiveoptions.ttl, and non-https iOS attachment URLs. Aconsole.warnfires when the serialized payload exceeds ~3500 UTF-8 bytes (measured withBuffer.byteLength, not JS code units, to correctly account for emoji / CJK content). -
Tests: Jest tests for the server SDK with 100% statement / branch / line / function coverage across
buildPayload.ts,ios.ts,android.ts,serialize.ts,validation.ts. Includes a kitchen-sink snapshot asserting the canonical FCM v1 wire shape. -
Docs: New docs/fcm-mode.md — comprehensive FCM Mode guide covering architecture, server SDK reference, client API reference, iOS NSE setup, Android specifics, payload schema, migration from manual pattern, troubleshooting, and known limitations. Root README and
packages/react-native/README.mdupdated with FCM Mode quick-start, Server SDK, CLI Tools, and Automated NSE setup sections.packages/react-native/server/README.mdexpanded with full API reference.apps/smoke/NOTIFICATION_SERVICE_EXTENSION.mdupdated with a CLI-recommendation header. Issue #129, Phase 5 of 5.
Fixed
- Client:
handleFcmMessageno longer throws an unhandled rejection when an iOS attachment innotifee_optionshas a missing or emptyurl. Invalid attachments are now filtered out with aconsole.warninstead of propagating to the validator. - Client:
reconstructNotificationnow emits aconsole.warnwhen a recognized Android style type (BIG_TEXT/BIG_PICTURE) is present but the required sub-field (text/picture) is missing. Previously the style was silently dropped with no diagnostic signal. - Client:
setFcmConfigandhandleFcmMessagenow deep-copy the nestediossub-object, preventing caller mutation from leaking into stored config. - CLI:
patchPodfilenow throws an error (triggering rollback) when it cannot locate the main app target's closingend, instead of silently appending the NSE block at file-end which would produce an invalid Podfile. - CLI:
--bundle-suffixis now validated against/^\.[A-Za-z0-9\-.]+$/to prevent pbxproj corruption from special characters. - CLI:
readParentTargetnow scopes the bundle ID search to the app target's ownbuildConfigurationListinstead of scanning all build configurations globally. Prevents returning a test target's bundle ID in multi-target projects. - CLI:
opts.dryRunis now forwarded topatchPodfileandpatchXcodeProjectcalls instead of being hardcoded tofalse. - CLI:
deriveBundleIdnow expands$(PRODUCT_NAME)/$(TARGET_NAME)variables in the parent bundle ID using the detected target name, instead of passing the unresolved variable through to the NSE bundle ID. A warning is still logged when the parent bundle ID uses unresolved variables the CLI cannot expand (e.g.$(PRODUCT_BUNDLE_PREFIX)), so the user can fix the NSE bundle ID manually in Xcode. - CLI:
patchXcodeProjectnow strips the RNFB-styleINFOPLIST_FILEinput path from the host target's build settings after adding the NSE target, avoiding an Xcode host-extension build cycle that prevented incremental builds. - CLI: Swift NSE template now uses the correct
with:Objective-C selector label (waswithContent:) when callingNotifeeExtensionHelper.populateNotificationContent, matching the ObjC method signature exposed viaNS_SWIFT_NAME. - iOS:
RNNotifeeCore.podspecnow declaresDEFINES_MODULE = YESso the NSE target canimport RNNotifeeCoreas a Swift module without a bridging header.
Changed
-
Package exports: packages/react-native/package.json now declares a formal
exportsmap (previously absent). Public entries:.,./server,./jest-mock,./react-native.config.js,./package.json. For backward compatibility with any consumer that was importing internal paths before 10.0.0,./src/*and./dist/*are also exposed — these are deprecated and will be removed in a future major. Migrate to the public exports (react-native-notify-kitfor the client,react-native-notify-kit/serverfor the server SDK). -
NSE template: Generated
NotificationService.swiftnow emits[NotifyKitNSE]NSLog diagnostics ondidReceive,contentHandler, andserviceExtensionTimeWillExpirepaths. Visible in Console.app by filtering on theNotifyKitNSEprocess, making it easier to diagnose missing attachments, missingnotifee_options, orserviceExtensionTimeWillExpiretermination on slow networks.
📦 npm: https://www.npmjs.com/package/react-native-notify-kit/v/10.0.0