@chipmobilesdk/rn-payment 0.2.1 → 0.3.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/CHANGELOG.md CHANGED
@@ -7,6 +7,23 @@ product keys, error codes, event names, state values, message keys, and the
7
7
  public API shape are this package's contract: renaming any of them is a breaking
8
8
  change.
9
9
 
10
+ ## [0.3.0] — 2026-10-13
11
+
12
+ Documentation release: the README and the agent skill now match the code `0.2.1` shipped.
13
+ **No code, API, storage or behaviour change** — upgrading from `0.2.1` changes nothing at
14
+ runtime. Released as its own version so the skill a consuming app syncs (`packageVersion`)
15
+ always matches the package it came from.
16
+
17
+ ### Changed
18
+
19
+ - README `### Migrating 0.1.0 to 0.2.0`: no longer claims `0.1.0` persisted pending records.
20
+ On a device nothing persisted before `0.2.1`; the section now says to use `0.2.1` or
21
+ later and what a device first running it does (empty record, `unknown` until the first
22
+ sync, never a false `not_entitled`).
23
+ - README intro: "Android only for now" instead of a version-pinned phrase.
24
+ - Skill: "Require `0.2.1` or later" under the upgrade notes, with the reason; the public
25
+ API heading names `v0.3.0` (the surface is unchanged since `0.2.0`).
26
+
10
27
  ## [0.2.1] — 2026-10-12
11
28
 
12
29
  Patch release. **Upgrade before shipping**: on a device, `0.2.0` and earlier persisted
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @chipmobilesdk/rn-payment
2
2
 
3
3
  Reusable in-app payment and entitlement capability for ChipMobileSdk-family React
4
- Native apps. Android only in 0.2.0, via Google Play Billing, behind a contract
4
+ Native apps. Android only for now, via Google Play Billing, behind a contract
5
5
  that is neutral with respect to platform and store.
6
6
 
7
7
  **The package owns capability. Your app owns policy.** The package gives you a
@@ -874,9 +874,12 @@ Everything else is additive, and `0.1.0` call sites compile and behave unchanged
874
874
  A hand-written `PaymentEngine` implementation, typically a test mock, needs the two
875
875
  new methods.
876
876
 
877
- **No storage migration.** The schema stays at version 1: pending records were
878
- already persisted by `0.1.0`, and `0.2.0` only reads them. A device upgrading with
879
- a payment in flight sees it in the pending set at first launch.
877
+ **No storage migration.** The schema stays at version 1, and `0.2.0` reads the
878
+ pending records the engine already wrote. **Use `0.2.1` or later**, though: before
879
+ `0.2.1` the store fell back to memory on every device (react-native-mmkv v4 has no
880
+ `MMKV` constructor), so nothing — entitlements included — survived a cold start. A
881
+ device first running `0.2.1` starts from an empty record and rebuilds it at the first
882
+ sync, with `unknown` meanwhile, never a false `not_entitled`.
880
883
 
881
884
  **Replacing an app-side workaround.** If you kept your own "pending since" marker
882
885
  because `0.1.0` could not show a pending payment in a later session, drop it for
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chipmobilesdk/rn-payment",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "description": "Reusable in-app payment and entitlement capability for ChipMobileSdk React Native apps",
@@ -3,7 +3,7 @@ name: sdk-rn-payment
3
3
  description: "In-app payments via @chipmobilesdk/rn-payment: Play Billing one-time/consumable/subscription behind a store-neutral contract, entitlement keys with a required unknown state, pending purchases visible across sessions, guaranteed transaction finalization, per-environment production-transaction blocking. Use when selling a feature, gating on an entitlement, showing a payment still pending after a restart, debugging a purchase that returns environment_blocked or an entitlement stuck at unknown, mapping Play products to entitlement keys, or answering a Data safety question about purchases."
4
4
  metadata:
5
5
  package: "@chipmobilesdk/rn-payment"
6
- packageVersion: "0.2.1"
6
+ packageVersion: "0.3.0"
7
7
  user-invocable: true
8
8
  disable-model-invocation: false
9
9
  ---
@@ -93,7 +93,7 @@ Unlike `@chipmobilesdk/rn-ads`, there is **no test-id substitution**: Play has n
93
93
  Call `handleForeground()` yourself on app resume — the package will not guess what
94
94
  "foreground" means for a host backgrounded by its own modal or the store's purchase sheet.
95
95
 
96
- ## Public API (v0.2.0)
96
+ ## Public API (v0.3.0)
97
97
 
98
98
  Runtime: `createEngine` (throws `PaymentConfigError` on a bad catalog or an unsafe
99
99
  environment; everything else returns a typed result) · `createStoreProvider` ·
@@ -131,8 +131,12 @@ Types: `PaymentConfig`, `CatalogEntry`, `ProductType`, `StoreProductIds`,
131
131
 
132
132
  One compile-time change: `PaymentEventType` gained `'purchase_pending_resolved'`, so an
133
133
  exhaustive `switch` needs the case or a `default`. A hand-written `PaymentEngine` mock
134
- needs the two pending methods. No storage migration — `0.1.0` already persisted pending
135
- records. Replace any app-side "pending since" marker with `usePendingPurchases`.
134
+ needs the two pending methods. No storage migration (schema unchanged). Replace any
135
+ app-side "pending since" marker with `usePendingPurchases`.
136
+
137
+ **Require `0.2.1` or later.** Earlier versions opened MMKV with the v3 constructor, which
138
+ react-native-mmkv v4 does not have, so on a device nothing persisted: owners read
139
+ `unknown` after every cold start and pending payments vanished after a kill.
136
140
 
137
141
  **Upgrade before shipping on Android.** In `0.1.0` the adapter misread `react-native-iap`
138
142
  16.x's string purchase state, so on a device a pending purchase was granted. `0.2.0`