|
1 | 1 | # RevenueCat production provisioning — Google Play |
2 | 2 |
|
3 | | -The client integration is complete (`Entitlements.kt` + runtime |
| 3 | +The entitlement-check integration exists (`Entitlements.kt` + runtime |
4 | 4 | `entitlements.py`). Live provisioning needs the RevenueCat dashboard, Play |
5 | | -Console, and Google Cloud; the following steps are the exact remaining |
6 | | -external work. |
| 5 | +Console, and Google Cloud. Purchase initiation and explicit restore controls |
| 6 | +remain repository work and are called out separately below. |
7 | 7 |
|
8 | 8 | ## Dashboard + Play connection |
9 | 9 |
|
10 | 10 | 1. Create the production project in RevenueCat. |
11 | 11 | - Record the **project id** here once created: `rc_<TO_FILL>`. |
| 12 | + - This project id is not an Android SDK API key. |
12 | 13 | 2. Add a **Google Play** app (`org.interdependency.ahbg`). |
13 | 14 | 3. Google Cloud Console: |
14 | 15 | - Create a **service account** for RevenueCat. |
15 | 16 | - Enable **Google Play Developer API** and **Google Play Reporting API**. |
16 | 17 | 4. Play Console → Users and permissions: |
17 | 18 | - Invite the service account email. |
18 | | - - Grant the permissions RevenueCat's current checklist requires (financial |
19 | | - data, view app information, manage orders, etc.). |
| 19 | + - Grant the permissions RevenueCat's current checklist requires. |
20 | 20 | 5. Generate a JSON key for the service account and upload it to RevenueCat. |
21 | | - - **hmmm**: RevenueCat notes Play service credentials can take up to 36 |
22 | | - hours to activate. |
23 | | -6. Create the entitlement `benchmark_lab` (non-consumable). |
24 | | -7. Create the product `ahbg_benchmark_lab` (one-time purchase, "Benchmark |
25 | | - Lab") — first create the matching Play in-app product after uploading a |
26 | | - test build — then attach it to the entitlement in a default offering. |
27 | | - Optionally add `ahbg_benchmark_lab_trial` if a trial is desired. |
28 | | -8. Copy the RevenueCat **public SDK API key** into the build: |
| 21 | + - **hmmm**: service-account permissions/credentials may take time to |
| 22 | + propagate after provisioning. |
| 23 | +6. Create the entitlement `benchmark_lab`. |
| 24 | +7. In Play Console, after uploading a test build, create |
| 25 | + `ahbg_benchmark_lab` as a one-time product and create/activate its |
| 26 | + **non-consumable purchase option**, including pricing and regional |
| 27 | + availability. |
| 28 | +8. Import/map that Play product in RevenueCat, attach it to `benchmark_lab`, |
| 29 | + and expose it through the default offering. |
| 30 | +9. Copy the Google Play app's RevenueCat **public SDK API key** (`goog_...`) |
| 31 | + into the build: |
29 | 32 |
|
30 | 33 | ```bash |
31 | 34 | gradle bundleRelease \ |
32 | 35 | -PruntimeUrl=https://ahbg.interdependentway.org \ |
33 | | - -PrevenueCatApiKey=<rc_public_sdk_key> \ |
| 36 | + -PrevenueCatApiKey=<goog_public_sdk_key> \ |
34 | 37 | -PahbgStoreFile=/secure/ahbg-release.jks -PahbgStorePassword=... \ |
35 | 38 | -PahbgKeyAlias=... -PahbgKeyPassword=... |
36 | 39 | ``` |
37 | 40 |
|
38 | | -9. SDK: RevenueCat `10.19.1` core supports Google Play by default through the |
39 | | - ordinary `PurchasesConfiguration`; no store module is required. |
| 41 | +10. RevenueCat `10.19.1` core supports Google Play through the ordinary |
| 42 | + `PurchasesConfiguration`; no Galaxy store module is required. |
| 43 | + |
| 44 | +## Repository billing controls — not complete |
| 45 | + |
| 46 | +Before the live Play billing gate can run, AHBG must expose user-visible |
| 47 | +operations that: |
| 48 | + |
| 49 | +1. fetch the current RevenueCat offering/package for `ahbg_benchmark_lab`; |
| 50 | +2. initiate the purchase and handle success/cancel/error outcomes; and |
| 51 | +3. invoke `Purchases.sharedInstance.restorePurchases`, then refresh the |
| 52 | + entitlement state. |
| 53 | + |
| 54 | +`getCustomerInfo` / `isBenchmarkLabUnlocked()` alone can observe an existing |
| 55 | +entitlement but cannot acquire or explicitly restore one. |
40 | 56 |
|
41 | 57 | ## Verify (gate items) |
42 | 58 |
|
43 | | -- **Free tier**: no key / no purchase → `NoopPremiumStore` or inactive |
44 | | - entitlement; Benchmark Lab locked; basic play and harness connectivity work. |
45 | | -- **Purchase**: Play sandbox purchase activates `benchmark_lab` → premium |
46 | | - surface unlocks in-app. |
47 | | -- **Trial** (if configured): trial start/expiry maps to the same entitlement. |
48 | | -- **Restore**: `Purchases.sharedInstance.restorePurchases` re-activates the |
49 | | - entitlement on the same account. (Add the restore button wiring to |
50 | | - `MainActivity` before release if review requires an explicit restore |
51 | | - control — currently restore uses the store-standard flow.) |
52 | | -- **Persistence**: entitlement state is re-fetched on launch; after a restart |
53 | | - the unlocked state must remain correct. |
54 | | -- **Degraded/offline**: RevenueCat errors and no-network states default to the |
55 | | - free tier (`isBenchmarkLabUnlocked() == false`); the app remains usable. |
| 59 | +Before any billing transaction, configure the purchasing Google account under |
| 60 | +Play Console **License testing** and use that same account to accept/install the |
| 61 | +test-track build. Test-track membership alone is not a sandbox guarantee. |
| 62 | + |
| 63 | +After the repository billing controls above exist: |
| 64 | + |
| 65 | +- **Free tier**: no purchase → inactive entitlement; Benchmark Lab locked; |
| 66 | + basic play and harness connectivity work. |
| 67 | +- **Purchase**: the license-test transaction activates `benchmark_lab` and the |
| 68 | + premium surface unlocks. |
| 69 | +- **Restore**: the explicit restore control calls RevenueCat restore and |
| 70 | + re-activates the entitlement for the same store account. |
| 71 | +- **Persistence**: entitlement state is re-fetched on launch; after restart the |
| 72 | + unlocked state remains correct. |
| 73 | +- **Degraded/offline**: RevenueCat errors/no-network default to the free tier; |
| 74 | + basic AHBG remains usable. |
56 | 75 |
|
57 | 76 | ## hmmm |
58 | 77 |
|
59 | | -- Actual project id, product ids, service-account JSON, and public SDK key |
60 | | - cannot be provisioned from this repository. |
61 | | -- Play sandbox purchases require the app uploaded to a Play test track first. |
| 78 | +- Actual project id, product configuration, service-account JSON, and `goog_...` |
| 79 | + SDK key require live accounts and cannot be provisioned from this repository. |
| 80 | +- The Play sandbox billing verification remains blocked until purchase/restore |
| 81 | + controls are implemented in the Android surface. |
0 commit comments