@invonetwork/web-sdk 3.35.0 → 3.37.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 +17 -0
- package/README.md +49 -2
- package/dist/{chunk-SCFK6IVH.js → chunk-AUHRMREF.js} +3 -3
- package/dist/{chunk-BGCSSWVL.js → chunk-KWAUFFDY.js} +23 -2
- package/dist/chunk-MENRG67H.js +6 -0
- package/dist/{chunk-XN6MCLQV.js → chunk-ZHEQAZLW.js} +32 -9
- package/dist/game-server.cjs +50 -6
- package/dist/game-server.d.cts +4 -4
- package/dist/game-server.d.ts +4 -4
- package/dist/game-server.js +5 -5
- package/dist/game.cjs +22 -1
- package/dist/game.d.cts +3 -3
- package/dist/game.d.ts +3 -3
- package/dist/game.js +3 -3
- package/dist/{hosted-approval-VQ3uyeDh.d.cts → hosted-approval-DS9gcCF5.d.cts} +1 -1
- package/dist/{hosted-approval-DIYUGgHi.d.ts → hosted-approval-Dv462L4e.d.ts} +1 -1
- package/dist/index.cjs +21 -0
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/{server-CMJHOmYL.d.ts → server-B7Pw1HMp.d.ts} +27 -2
- package/dist/{server-DF-BZU0B.d.cts → server-B9PtYZaM.d.cts} +27 -2
- package/dist/server.cjs +50 -6
- package/dist/server.d.cts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/server.js +3 -3
- package/dist/{types-Dv0UavA9.d.cts → types-BdKpJX93.d.cts} +42 -2
- package/dist/{types-Dv0UavA9.d.ts → types-BdKpJX93.d.ts} +42 -2
- package/dist/{version-DB2wgiPY.d.cts → version-CuhMO-6s.d.cts} +1 -1
- package/dist/{version-DB2wgiPY.d.ts → version-CuhMO-6s.d.ts} +1 -1
- package/docs/apple-in-app-purchases.md +53 -10
- package/package.json +1 -1
- package/dist/chunk-6763YM7P.js +0 -6
|
@@ -12,6 +12,7 @@ the app.
|
|
|
12
12
|
|
|
13
13
|
- [How it works in one paragraph](#how-it-works-in-one-paragraph)
|
|
14
14
|
- [Prerequisites](#prerequisites)
|
|
15
|
+
- [In-App Purchase API key](#in-app-purchase-api-key)
|
|
15
16
|
- [The purchase flow](#the-purchase-flow)
|
|
16
17
|
- [When to call Transaction.finish()](#when-to-call-transactionfinish)
|
|
17
18
|
- [Errors](#errors)
|
|
@@ -63,10 +64,50 @@ StoreKit keeps redelivering it, and every redelivery is a safe retry.
|
|
|
63
64
|
`notification_url`. In App Store Connect (App Information, App Store Server Notifications),
|
|
64
65
|
set the **Production** server URL to the URL shown in the live console, and the **Sandbox**
|
|
65
66
|
server URL to the URL shown in the test console for your sandbox game. INVO uses these for
|
|
66
|
-
refunds
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
refunds. Do this before adding the key: INVO refuses a key for an app with no notification
|
|
68
|
+
URL (`APPLE_NOTIFICATION_URL_MISSING`).
|
|
69
|
+
|
|
70
|
+
6. **Your In-App Purchase API key in the INVO console.** Required to sell on the live App Store.
|
|
71
|
+
See [In-App Purchase API key](#in-app-purchase-api-key).
|
|
72
|
+
|
|
73
|
+
## In-App Purchase API key
|
|
74
|
+
|
|
75
|
+
Selling on the live App Store requires your App Store Server API key (App Store Connect calls it
|
|
76
|
+
an In-App Purchase key) on the game in the live INVO console. INVO does not ask for access to
|
|
77
|
+
your App Store Connect account. With the key, INVO checks transactions with Apple independently,
|
|
78
|
+
reconciles refunds whose notification never arrived (every 6 hours, for purchases from the last
|
|
79
|
+
120 days), and verifies your app without a support step. Each purchase is still checked against Apple's signature; the key is not used to credit one.
|
|
80
|
+
|
|
81
|
+
This is a console action. There is nothing to call in the SDK.
|
|
82
|
+
|
|
83
|
+
1. In App Store Connect, as the Account Holder or an Admin, open **Users and Access**, then
|
|
84
|
+
**Integrations**, then **In-App Purchase**, and **Generate** a key. Note the **Issuer ID** and
|
|
85
|
+
the **Key ID**, and download the `.p8` file (App Store Connect offers the download once).
|
|
86
|
+
2. In the INVO console, save the game's Apple configuration and set the notification URLs in
|
|
87
|
+
App Store Connect (prerequisite 5) first, then paste the Issuer ID, the
|
|
88
|
+
Key ID and the full contents of the `.p8` file (including the `BEGIN` and `END` lines). Only
|
|
89
|
+
the account owner can do this.
|
|
90
|
+
3. On save, INVO checks the key with Apple (it asks Apple to send a test notification). A key
|
|
91
|
+
Apple refuses is never stored. Apple accepts only a key from the account that owns the app,
|
|
92
|
+
so acceptance is the proof of ownership: **the app is verified at once**, with nothing to wait
|
|
93
|
+
for. The console shows `APPLE_KEY_ACCEPTED` ("Key accepted. Apple confirmed it belongs to this
|
|
94
|
+
app, and the app is verified.").
|
|
95
|
+
|
|
96
|
+
The key is stored encrypted and never shown again; the console shows only the Issuer ID, the Key
|
|
97
|
+
ID and when it was last checked. To rotate, save a new key (it replaces the old one only once
|
|
98
|
+
Apple accepts it), then revoke the old one in App Store Connect. Removing the key in the console
|
|
99
|
+
stops INVO using it at once; purchases keep crediting. Changing the bundle id clears the key;
|
|
100
|
+
upload it again.
|
|
101
|
+
|
|
102
|
+
| Code | HTTP | Meaning |
|
|
103
|
+
|---|---|---|
|
|
104
|
+
| `APPLE_ISSUER_ID_INVALID` | 400 | not an Issuer ID (a UUID) |
|
|
105
|
+
| `APPLE_KEY_ID_INVALID` | 400 | not a Key ID (10 capital letters and digits) |
|
|
106
|
+
| `APPLE_KEY_INVALID` | 400 | the `.p8` contents could not be read; paste the whole file |
|
|
107
|
+
| `APPLE_KEY_REJECTED` | 400 | Apple refused the key for this app; nothing was stored |
|
|
108
|
+
| `APPLE_NOTIFICATION_URL_MISSING` | 400 | App Store Connect has no notification URL for the app; paste INVO's URL first, then save the key again |
|
|
109
|
+
| `APPLE_NOT_CONFIGURED` | 409 | save the Apple configuration before the key |
|
|
110
|
+
| other | 502 / 503 | Apple or INVO could not complete the check; try again |
|
|
70
111
|
|
|
71
112
|
## The purchase flow
|
|
72
113
|
|
|
@@ -260,12 +301,13 @@ the Sandbox notification URL, so production does not take those coins back.
|
|
|
260
301
|
Production sells only once INVO has confirmed you own the App Store app (`APPLE_NOT_VERIFIED`
|
|
261
302
|
until then). The first genuine, recent App Store Server Notification INVO receives at your
|
|
262
303
|
production `notification_url` verifies it, because only the app's owner in App Store Connect can
|
|
263
|
-
point Apple's notifications there.
|
|
264
|
-
|
|
265
|
-
the
|
|
266
|
-
|
|
304
|
+
point Apple's notifications there. The normal, self-serve path is to add your
|
|
305
|
+
[In-App Purchase API key](#in-app-purchase-api-key): Apple accepting the key proves ownership,
|
|
306
|
+
so the app is verified immediately. The console shows `verified` and `verified_at`. If you cannot
|
|
307
|
+
add the key, or the app is still not verified after you do, ask INVO support; that is the
|
|
308
|
+
fallback.
|
|
267
309
|
|
|
268
|
-
Changing the bundle id before the game has sold through Apple clears verification; after the
|
|
310
|
+
Changing the bundle id before the game has sold through Apple clears verification and the key; after the
|
|
269
311
|
first sale the bundle id cannot change (`APPLE_BUNDLE_LOCKED`). Each bundle id has one verified
|
|
270
312
|
owner across INVO (`APPLE_BUNDLE_ALREADY_REGISTERED`).
|
|
271
313
|
|
|
@@ -375,7 +417,8 @@ launch.
|
|
|
375
417
|
- Consumable products exist in App Store Connect and in the INVO console with the same ids.
|
|
376
418
|
- The game's iOS key shows the Apple rail in the console.
|
|
377
419
|
- Billing is set up, and `appleProducts()` on production shows `canSell: true`.
|
|
378
|
-
- Both notification URLs are set in App Store Connect
|
|
420
|
+
- Both notification URLs are set in App Store Connect.
|
|
421
|
+
- Your In-App Purchase API key is saved in the live console, and production shows `verified`.
|
|
379
422
|
- The App Review email is on the game's App Review list and in your review notes.
|
|
380
423
|
- The app asks `appleProducts()` before showing the store, offers only `available` products,
|
|
381
424
|
verifies from your server, and finishes only when `finish` is `true`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@invonetwork/web-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.37.0",
|
|
4
4
|
"description": "INVO Web SDK — currency purchase, passkey (WebAuthn) verification, loyalty, and a drop-in game economy layer (wallet, shop, hosted checkout) for partner web platforms and browser games.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"private": false,
|