Skip to content

10.0.0

Choose a tag to compare

@marcocrupi marcocrupi released this 16 Apr 22:47
· 318 commits to main since this release
Immutable release. Only release title and notes can be modified.

Added

  • CLI bin wiring: npx react-native-notify-kit init-nse now works out-of-the-box after npm install react-native-notify-kit. CLI is prepacked into the main package at publish time. CLI deps (xcode, commander, chalk, plist) ship as optionalDependencies. E2E tarball regression script validates the full consumer flow. Issue #129, Phase 4 of 4.

  • CLI init-nse: npx react-native-notify-kit init-nse scaffolds an iOS Notification Service Extension target, patching .pbxproj and Podfile automatically. Generates Swift + NotifyKitNSE target using NotifeeExtensionHelper for push enrichment. Supports --dry-run, --force, --target-name, --ios-path options. 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 with notifee_options payloads. Parses the server SDK's serialized blob, reconstructs a Notification object, 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 via setFcmConfig. Issue #129, Phase 2 of 4.

  • Client FCM config: notifee.setFcmConfig(config) — optional startup configuration for handleFcmMessage. Covers: defaultChannelId, defaultPressAction, fallbackBehavior ('display' or 'ignore'), and ios.suppressForegroundBanner.

  • Server SDK: new react-native-notify-kit/server subpath export. A zero-runtime-dependency Node.js / Firebase Cloud Functions helper that builds FCM HTTP v1 message payloads ready for admin.messaging().send(). Android messages are emitted data-only so the FCM SDK never auto-displays; iOS messages use alert-style APNs with mutable-content: 1 so the Notification Service Extension always activates. Both platforms carry an identical notifee_options blob (_v: 1) that the upcoming Phase 2 client handler will consume. Issue #129, Phase 1 of 4.

    Public API: buildNotifyKitPayload, buildIosApnsPayload, buildAndroidPayload, serializeNotifeeOptions, and all NotifyKit* 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 in notification.data, the reserved keys notifee_options / notifee_data in user data, empty-string notification.id, non-integer or non-positive options.ttl, and non-https iOS attachment URLs. A console.warn fires when the serialized payload exceeds ~3500 UTF-8 bytes (measured with Buffer.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.md updated with FCM Mode quick-start, Server SDK, CLI Tools, and Automated NSE setup sections. packages/react-native/server/README.md expanded with full API reference. apps/smoke/NOTIFICATION_SERVICE_EXTENSION.md updated with a CLI-recommendation header. Issue #129, Phase 5 of 5.

Fixed

  • Client: handleFcmMessage no longer throws an unhandled rejection when an iOS attachment in notifee_options has a missing or empty url. Invalid attachments are now filtered out with a console.warn instead of propagating to the validator.
  • Client: reconstructNotification now emits a console.warn when 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: setFcmConfig and handleFcmMessage now deep-copy the nested ios sub-object, preventing caller mutation from leaking into stored config.
  • CLI: patchPodfile now throws an error (triggering rollback) when it cannot locate the main app target's closing end, instead of silently appending the NSE block at file-end which would produce an invalid Podfile.
  • CLI: --bundle-suffix is now validated against /^\.[A-Za-z0-9\-.]+$/ to prevent pbxproj corruption from special characters.
  • CLI: readParentTarget now scopes the bundle ID search to the app target's own buildConfigurationList instead of scanning all build configurations globally. Prevents returning a test target's bundle ID in multi-target projects.
  • CLI: opts.dryRun is now forwarded to patchPodfile and patchXcodeProject calls instead of being hardcoded to false.
  • CLI: deriveBundleId now 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: patchXcodeProject now strips the RNFB-style INFOPLIST_FILE input 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 (was withContent:) when calling NotifeeExtensionHelper.populateNotificationContent, matching the ObjC method signature exposed via NS_SWIFT_NAME.
  • iOS: RNNotifeeCore.podspec now declares DEFINES_MODULE = YES so the NSE target can import RNNotifeeCore as a Swift module without a bridging header.

Changed

  • Package exports: packages/react-native/package.json now declares a formal exports map (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-kit for the client, react-native-notify-kit/server for the server SDK).

  • NSE template: Generated NotificationService.swift now emits [NotifyKitNSE] NSLog diagnostics on didReceive, contentHandler, and serviceExtensionTimeWillExpire paths. Visible in Console.app by filtering on the NotifyKitNSE process, making it easier to diagnose missing attachments, missing notifee_options, or serviceExtensionTimeWillExpire termination on slow networks.


📦 npm: https://www.npmjs.com/package/react-native-notify-kit/v/10.0.0