Skip to content

Commit

Permalink
feat(purchases): update to plugin version 1.2.0 (#3482)
Browse files Browse the repository at this point in the history
* updates to 1.2.0

* fixes linter errors
  • Loading branch information
vegaro authored Aug 14, 2020
1 parent 26d10ef commit a010bb1
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions src/@ionic-native/plugins/purchases/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {}
Expand Down Expand Up @@ -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 {}

}

/**
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit a010bb1

Please sign in to comment.