From a010bb186964b8b825ab80f9cf6092794ee2e4b1 Mon Sep 17 00:00:00 2001 From: Cesar de la Vega Date: Fri, 14 Aug 2020 08:35:06 -0700 Subject: [PATCH] feat(purchases): update to plugin version 1.2.0 (#3482) * updates to 1.2.0 * fixes linter errors --- src/@ionic-native/plugins/purchases/index.ts | 35 +++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/src/@ionic-native/plugins/purchases/index.ts b/src/@ionic-native/plugins/purchases/index.ts index ccf86fcd7e..b923c2233c 100644 --- a/src/@ionic-native/plugins/purchases/index.ts +++ b/src/@ionic-native/plugins/purchases/index.ts @@ -207,7 +207,7 @@ export enum INTRO_ELIGIBILITY_STATUS { */ @Plugin({ pluginName: 'Purchases', - plugin: 'cordova-plugin-purchases@1.1.0', + plugin: 'cordova-plugin-purchases@1.2.0', pluginRef: 'Purchases', // the variable reference to call the plugin, example: navigator.geolocation repo: 'https://github.com/RevenueCat/cordova-plugin-purchases', // the github repository URL for the plugin platforms: ['Android', 'iOS'], // Array of platforms supported, example: ['Android', 'iOS'] @@ -259,9 +259,12 @@ export class Purchases extends IonicNativePlugin { * @param {boolean} observerMode An optional boolean. Set this to TRUE if you have your own IAP implementation and * want to use only RevenueCat's backend. Default is FALSE. If you are on Android and setting this to ON, you will have * to acknowledge the purchases yourself. + * @param {string?} userDefaultsSuiteName An optional string. iOS-only, will be ignored for Android. + * Set this if you would like the RevenueCat SDK to store its preferences in a different NSUserDefaults + * suite, otherwise it will use standardUserDefaults. Default is null, which will make the SDK use standardUserDefaults. */ @Cordova({ sync: true }) - setup(apiKey: string, appUserID?: string | null, observerMode = false): void {} + setup(apiKey: string, appUserID?: string | null, observerMode = false, userDefaultsSuiteName?: string): void {} /** * Set this to true if you are passing in an appUserID but it is anonymous, this is true by default if you didn't pass an appUserID @@ -539,8 +542,13 @@ export class Purchases extends IonicNativePlugin { /** * Invalidates the cache for purchaser information. - * This is useful for cases where purchaser information might have been updated outside of the app, like if a - * promotional subscription is granted through the RevenueCat dashboard. + * + * Most apps will not need to use this method; invalidating the cache can leave your app in an invalid state. + * Refer to https://docs.revenuecat.com/docs/purchaserinfo#section-get-user-information for more information on + * using the cache properly. + * + * This is useful for cases where purchaser information might have been updated outside of the + * app, like if a promotional subscription is granted through the RevenueCat dashboard. */ @Cordova({ sync: true }) invalidatePurchaserInfoCache(): void {} @@ -589,6 +597,13 @@ export class Purchases extends IonicNativePlugin { @Cordova({ sync: true }) setPushToken(pushToken: string | null): void {} + /** + * Set this property to your proxy URL before configuring Purchases *only* if you've received a proxy key value from your RevenueCat contact. + * @param url Proxy URL as a string. + */ + @Cordova({ sync: true }) + setProxyURL(url: string): void {} + } /** @@ -727,6 +742,18 @@ export interface PurchaserInfo { * in Android */ readonly originalApplicationVersion: string | null; + /** + * Returns the purchase date for the version of the application when the user bought the app. + * Use this for grandfathering users when migrating to subscriptions. + */ + readonly originalPurchaseDate: string | null; + /** + * URL to manage the active subscription of the user. If this user has an active iOS + * subscription, this will point to the App Store, if the user has an active Play Store subscription + * it will point there. If there are no active subscriptions it will be null. + * If there are multiple for different platforms, it will point to the device store. + */ + readonly managementURL: string | null; } export interface PurchasesProduct {