fix(native): App Review findings on buying TREK Cloud in the app

- Orders closed at the cloud: the app shows the plans and that TREK Cloud
  opens soon, and sells only in a test build (TestFlight, App Review), whose
  sandbox purchases the cloud still sets up; a store purchase it would refuse
  is never offered. The plans arrive without prices then, the store's own are
  shown where it gives them.
- A purchase paid but never set up (Ask to Buy approved later, the app closed
  mid-purchase) is picked up by Restore purchases and goes on to the claim with
  that purchase, instead of failing; nothing is bought twice.
- The buy button names the period with the price (guideline 3.1.2).
- The privacy link opens the policy without the site's sales header.
- The privacy manifest declares what TREK Cloud keeps: email, name, the store
  purchase, photos, other user content and saved places, all for the app to
  work, linked to the account, never for tracking.
- The email hint promises messages about the contract, not receipts, which the
  store sends.
This commit is contained in:
Maurice
2026-11-07 11:48:03 +01:00
parent 354e30a075
commit 6e1c9e8e9f
35 changed files with 225 additions and 56 deletions
+11
View File
@@ -58,6 +58,17 @@ describe('native client', () => {
expect(await nativeIapClient.isAvailable()).toBe(false);
});
it('knows a test build from a store one, and takes an error for a store build', async () => {
shell.storeProducts.mockResolvedValue({ products: [], sandbox: true });
expect(await nativeIapClient.isSandbox()).toBe(true);
expect(shell.storeProducts).toHaveBeenCalledWith({ ids: [] });
shell.storeProducts.mockResolvedValue({ products: [] });
expect(await nativeIapClient.isSandbox()).toBe(false);
shell.storeProducts.mockRejectedValue(new Error('no store'));
expect(await nativeIapClient.isSandbox()).toBe(false);
expect(await fakeIapClient.isSandbox()).toBe(true);
});
it('maps the store price strings by product', async () => {
shell.storeProducts.mockResolvedValue({ products: [{ id: 'cloud.plus.monthly', displayPrice: '9,99 €' }] });
const prices = await nativeIapClient.prices(['cloud.plus.monthly', 'cloud.pro.monthly']);