@chipmobilesdk/rn-notification 0.1.0 → 0.1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chipmobilesdk/rn-notification",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "main": "src/index.ts",
@@ -38,6 +38,7 @@
38
38
  "src/schedule",
39
39
  "src/state",
40
40
  "src/testing",
41
+ "skills",
41
42
  "README.md",
42
43
  "CHANGELOG.md"
43
44
  ],
@@ -0,0 +1,102 @@
1
+ ---
2
+ name: sdk-rn-notification
3
+ description: "Local and push notifications via @chipmobilesdk/rn-notification: scheduling, identifiers, wall-clock vs absolute anchoring, idempotent reconciliation, recurrence windows, permissions, Android channel migration, tap routing, FCM. Use when scheduling a reminder, handling a notification tap, requesting notification permission, changing a channel, or debugging a notification that did not arrive."
4
+ metadata:
5
+ package: "@chipmobilesdk/rn-notification"
6
+ packageVersion: "0.1.1"
7
+ user-invocable: true
8
+ disable-model-invocation: false
9
+ ---
10
+
11
+ # @chipmobilesdk/rn-notification
12
+
13
+ Scheduled local notifications with stable identity and idempotent reconciliation,
14
+ provider-agnostic push, permissions, declarative channels and tones, and tap routing that
15
+ survives a cold start.
16
+
17
+ ## Use this when
18
+
19
+ - Scheduling, replacing, or cancelling a notification
20
+ - Reacting to a tap, an action button, or a dismissal
21
+ - Requesting notification or exact-alarm permission
22
+ - Declaring or changing a tone/channel, or enabling push
23
+ - Debugging a notification that did not arrive, or arrived twice
24
+
25
+ **Not** for in-app banners or an inbox (this package renders nothing), for storing app
26
+ data (`@chipmobilesdk/rn-local-db`), or for translating text — resolve strings yourself.
27
+
28
+ ## Read before writing any code
29
+
30
+ Three things cause most of the bugs, and none is visible in the type signatures:
31
+
32
+ 1. **Identifiers are yours and must be derived from data.** `crypto.randomUUID()` means
33
+ you can never replace or cancel what you scheduled. Nothing is normalized, so
34
+ `Task:1` and `task:1` are two different notifications.
35
+ 2. **Wall-clock is the default anchoring mode** — an 08:00 reminder stays 08:00 after the
36
+ user changes time zone. One case re-anchoring cannot fix: read
37
+ `### What re-anchoring cannot fix` before promising exact behaviour to anyone.
38
+ 3. **Reconciliation is never automatic.** The package maintains its own recurrence windows
39
+ and re-anchoring, but never invents a desired set. Data changed and you did not call
40
+ `reconcile()` means the device is stale, by design.
41
+
42
+ Read `## Choosing identifiers`, `## Choosing an anchoring mode`, and
43
+ `## Maintenance versus reconciliation` before designing anything.
44
+
45
+ **A refusal must never break the user's work.** Permission denial is a degradation, not a
46
+ failure: the caller's operation still succeeds and the lost capability is reported
47
+ separately. Without exact-alarm capability notifications are still scheduled, flagged
48
+ `mayBeDelayed`. Never gate a user action on a permission answer.
49
+
50
+ ## Android: two manifest entries you must add yourself
51
+
52
+ Consumer-owned; this package cannot ship either.
53
+
54
+ - **`SCHEDULE_EXACT_ALARM` arrives whether you want it or not** — the engine declares it
55
+ and manifest merging is transitive. It is store-restricted and needs a Play Console
56
+ declaration. Remove it with `tools:node="remove"` unless you need precise timing.
57
+ - **Backup exclusion** for the state record — a deduplication ledger restored onto another
58
+ device claims payloads were already delivered, silently suppressing real ones.
59
+
60
+ See `### Android` and `### Backup exclusion`.
61
+
62
+ ## Public API
63
+
64
+ Three entrypoints. The **root** exports one factory per concern (`createScheduler`,
65
+ `createReconciler`, `createRecurrence`, `createPermissions`, `createChannels`,
66
+ `createInteractions`, `createSnapshot`), the maintenance steps and their registry, plus
67
+ `resolveTone`, `resetState`, `clearOwner`, `isNonFailure` and `DIAGNOSTIC_CODES`.
68
+ **`/push`** carries the push gate, FCM provider, instruction handler and sign-out —
69
+ **import it only if you enable push**, because an app that never touches this subpath ships
70
+ no provider code, no push permissions, and no entitlements. **`/testing`** carries the fake
71
+ engine and provider, the conformance suite and the fault injector.
72
+
73
+ Enumerate exact names from `node_modules/@chipmobilesdk/rn-notification/src/index.ts`
74
+ rather than guessing.
75
+
76
+ ## Where the detail lives
77
+
78
+ `node_modules/@chipmobilesdk/rn-notification/README.md`:
79
+
80
+ | Need | Section |
81
+ |---|---|
82
+ | Install, peers, enabling push | `## Installation`, `### Enabling push (optional)` |
83
+ | Native setup | `### iOS`, `### Android`, `### Backup exclusion` |
84
+ | Naming notifications | `## Choosing identifiers` |
85
+ | Time zones and travel | `## Choosing an anchoring mode` |
86
+ | Automatic vs your responsibility | `## Maintenance versus reconciliation` |
87
+ | Converging the device to your data | `## Reconciliation`, `## Recurrence` |
88
+ | Permission timing and recovery | `## Permissions` |
89
+ | Taps, actions, cold start | `## Interaction` |
90
+ | Push and the backend contract | `## Push` |
91
+ | On-device storage and privacy | `## What is persisted`, `## Data behaviour …` |
92
+ | Limits and timing budgets | `## Budgets` |
93
+ | Error codes | `## Diagnostic identifiers` |
94
+
95
+ ## Debugging "it did not arrive"
96
+
97
+ Capture a state snapshot (`createSnapshot`) before guessing — permissions, applied channel
98
+ versions, pending set, last maintenance cycle, discrepancies and state health, in one
99
+ place. Some codes are **reported outcomes, not failures** (`TRUNCATED_OVER_CEILING`,
100
+ `EXACT_ALARM_UNAVAILABLE`, `PENDING_SET_DISCREPANCY`, `BURST_THRESHOLD_EXCEEDED`,
101
+ `PAYLOAD_VERSION_SKEW`); use `isNonFailure(code)` rather than treating every code as an
102
+ error.