mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-21 19:40:34 +00:00
fix(native): a store account with a running TREK Cloud subscription buys no second one
One subscription per Apple ID or Google account. Choosing another plan in the app changed the running subscription on the App Store, and the redeem then failed with 'We could not set up your TREK'. The app now asks the store first and shows a screen of its own: the account already has TREK Cloud, a new one can be taken out once it has ended, with Open my TREK and the store's page to manage it. The native purchase refuses as well; a paid one that was never set up is still redeemed. On the address screens the link 'What is a TREK server?' is gone, and the small print under a purchase is set in the system text face at regular weight.
This commit is contained in:
@@ -112,7 +112,8 @@ export interface TrekShellPlugin {
|
||||
* Android `purchaseToken`, which the control plane verifies with Google Play.
|
||||
*/
|
||||
storePurchase(options: { productId: string }): Promise<{
|
||||
kind: 'bought' | 'cancelled' | 'pending' | 'failed';
|
||||
/** `subscribed`: this store account already holds a delivered subscription, so nothing was bought. */
|
||||
kind: 'bought' | 'cancelled' | 'pending' | 'failed' | 'subscribed';
|
||||
jws?: string;
|
||||
purchaseToken?: string;
|
||||
productId?: string;
|
||||
@@ -134,6 +135,11 @@ export interface TrekShellPlugin {
|
||||
}): Promise<{ result: 'shown' | 'unsupported' }>;
|
||||
/** iOS, feature storeKit: the newest active subscription under `prefix` on this Apple ID, if any. */
|
||||
storeRestore(options: { prefix: string }): Promise<{ jws?: string; transactionId?: string }>;
|
||||
/**
|
||||
* Whether this Apple ID or Google account holds a delivered subscription under
|
||||
* `prefix`, read without asking for a password. Not in builds before 5.1.4.
|
||||
*/
|
||||
storeHeld(options: { prefix: string }): Promise<{ held: boolean }>;
|
||||
/** Feature watch: what the Apple Watch app shows (native/watch.ts), as JSON, sent on through WatchConnectivity. */
|
||||
setWatchSnapshot(options: { json: string }): Promise<void>;
|
||||
/** Feature watch: the ticks the watch sent since the last call, oldest first (parsed by parseWatchActions). */
|
||||
|
||||
Reference in New Issue
Block a user