@solidnative-dev/notifications

Validated local notifications and owner-scoped foreground notification events for Solid Native. The first backend targets Notify Kit 10.5 (NotifeeApiModule) via injected generated bindings without evaluating its React-facing JavaScript facade.

Installation#

sh
pnpm add @solidnative-dev/notifications @notifee/react-native

Generate the native binding for your app and pass the resolved NotifeeApiModule and low-level native event source into the adapter (see the checked-in NotifeeApiModule seam).

Usage#

ts
import { createNotifyKit10NotificationService } from "@solidnative-dev/notifications/notify-kit-10";
import { createNotificationEvent } from "@solidnative-dev/notifications/solid";

const notifications = createNotifyKit10NotificationService(
  generatedNotifeeModule,
  nativeEventSource,
  {
    platform: "android",
    androidSmallIcon: "solid_native_notification",
  },
);

const latestEvent = createNotificationEvent(notifications, {
  onError: console.error,
});

await notifications.requestPermission();
await notifications.display({
  id: "sync-complete",
  title: "Sync complete",
  channel: { id: "application", name: "Application" },
});

Entrypoints#

ImportKey exports
@solidnative-dev/notificationscreateNotificationService, NotificationService, LocalNotification, NotificationChannel, NotificationPermission, NotificationEvent
@solidnative-dev/notifications/notify-kit-10createNotifyKit10NotificationService, NotifyKit10NativeModule, NotifyKit10NativeEventSource, NOTIFY_KIT_10_FOREGROUND_EVENT
@solidnative-dev/notifications/solidcreateNotificationEvent, NotificationEventSource, NotificationEventAccessorOptions

Causal event mapping#

KindCausal event namePriority
deliveredplatform.notification.delivereddefault
pressedplatform.notification.presseddiscrete
action-pressedplatform.notification.action-presseddiscrete
dismissedplatform.notification.dismisseddefault
unknownplatform.notification.unknowndefault

Behavior & platform notes#

  • Owner-scoped reactivity: createNotificationEvent accepts either a service or a reactive accessor, automatically swapping subscriptions on change and detaching on owner disposal. Diagnostic errors are isolated via onError.
  • Android body press: The Notify Kit 10 adapter installs { id: "default", launchActivity: "default" } on Android so tapping a notification reliably reopens the app and emits pressed.
  • iOS permission timing: Wait until the app returns to the active state after the iOS permission prompt before calling display(), otherwise UIKit's brief inactive state causes Notify Kit to route the event as a background delivery.
  • Privacy & scope: Notification IDs, titles, and bodies stay out of causal telemetry. Remote push credentials, rich action buttons, and background execution remain app-shell responsibilities.