@mpgd/capacitor-storekit 0.2.2 → 0.2.3
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/README.md +21 -0
- package/dist/store-sdk.js +4 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -131,6 +131,27 @@ and lists each skipped vector with its reason (host or server finish,
|
|
|
131
131
|
quantity, server-push, an asynchronous store error event StoreKit never
|
|
132
132
|
emits, and a pending transaction state StoreKit never reports).
|
|
133
133
|
|
|
134
|
+
### Generated games
|
|
135
|
+
|
|
136
|
+
Games generated by `mpgd game create` (and the kit's private starter) ship
|
|
137
|
+
this wiring in `src/platform/buildGateways/capacitorIos.ts` (commerce v2 PR
|
|
138
|
+
C3): the service provider is registered for every catalog product whose
|
|
139
|
+
`platformProductIds.ios` names an App Store product id (subscriptions are
|
|
140
|
+
skipped), and `getAppAccountToken` is the reference binding in
|
|
141
|
+
`src/platform/commerceAccountBinding.ts`, a UUID (version 5 layout) over the
|
|
142
|
+
SHA-256 of `mpgd-commerce-account:<playerId>` for the authenticated player;
|
|
143
|
+
a guest session throws, so no sheet opens without a binding. The backend's
|
|
144
|
+
`resolveAppAccountToken` must derive the same UUID, or both are replaced
|
|
145
|
+
together.
|
|
146
|
+
|
|
147
|
+
`mpgd target init capacitor --providers storekit` installs this package into
|
|
148
|
+
the game-owned shell and the game at one exact version and lets `cap add` or
|
|
149
|
+
`cap sync` register its Swift package; on a game that still has the unwired
|
|
150
|
+
gateway of an earlier template it also writes the wiring above. A build
|
|
151
|
+
whose shell lacks the native plugin still runs: the plugin answers
|
|
152
|
+
Capacitor's `UNIMPLEMENTED`, which the SDK reports as
|
|
153
|
+
`configuration-required`, so no purchase sheet opens.
|
|
154
|
+
|
|
134
155
|
## v1 provider and recovery
|
|
135
156
|
|
|
136
157
|
On startup, account restoration, and after a pending or uncertain checkout,
|
package/dist/store-sdk.js
CHANGED
|
@@ -396,7 +396,10 @@ export function createCapacitorStoreKitStoreSdk(input) {
|
|
|
396
396
|
}
|
|
397
397
|
catch (error) {
|
|
398
398
|
const code = isRecord(error) ? error.code : undefined;
|
|
399
|
-
|
|
399
|
+
// Capacitor's `UNIMPLEMENTED` means the native plugin is not installed in the shell.
|
|
400
|
+
return code === 'STOREKIT_INVALID_PRODUCTS'
|
|
401
|
+
|| code === 'STOREKIT_PRODUCT_UNAVAILABLE'
|
|
402
|
+
|| code === 'UNIMPLEMENTED'
|
|
400
403
|
? 'configuration-required'
|
|
401
404
|
: 'temporarily-unavailable';
|
|
402
405
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpgd/capacitor-storekit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Opt-in StoreKit 2 one-time purchase collector and commerce v2 provider for mpgd Capacitor games.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
],
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@capacitor/core": "^8.5.1",
|
|
41
|
-
"@mpgd/adapter-capacitor": "^0.9.
|
|
41
|
+
"@mpgd/adapter-capacitor": "^0.9.3",
|
|
42
42
|
"@mpgd/bridge": "^0.12.3",
|
|
43
43
|
"@mpgd/platform": "^0.22.0"
|
|
44
44
|
},
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"@capacitor/core": "8.5.2",
|
|
47
47
|
"ttsc": "0.30.4",
|
|
48
48
|
"typescript": "7.0.2",
|
|
49
|
-
"@mpgd/adapter-capacitor": "0.9.
|
|
50
|
-
"@mpgd/bridge": "0.12.3",
|
|
49
|
+
"@mpgd/adapter-capacitor": "0.9.3",
|
|
51
50
|
"@mpgd/platform": "0.22.0",
|
|
52
|
-
"@mpgd/game-services": "0.
|
|
51
|
+
"@mpgd/game-services": "0.23.0",
|
|
52
|
+
"@mpgd/bridge": "0.12.3"
|
|
53
53
|
},
|
|
54
54
|
"main": "./dist/index.js",
|
|
55
55
|
"types": "./dist/index.d.ts",
|