Skip to content

Commit

Permalink
feat(purchases): bump cordova-plugin-purchases from 1.3.2 to 2.0.0 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
aboedo authored Jan 23, 2021
1 parent b4f0f07 commit bed8797
Showing 1 changed file with 10 additions and 27 deletions.
37 changes: 10 additions & 27 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.3.2',
plugin: 'cordova-plugin-purchases@2.0.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 @@ -318,31 +318,6 @@ export class Purchases extends IonicNativePlugin {
* @property {PurchaserInfo} purchaserInfo - The new PurchaserInfo after the successful purchase
*/

/**
* Make a purchase
*
* @deprecated Use purchaseProduct instead.
*
* @param {string} productIdentifier The product identifier of the product you want to purchase.
* @param {string?} oldSKU Optional sku you wish to upgrade from.
* @param {PURCHASE_TYPE} type Optional type of product, can be inapp or subs. Subs by default
*
* @return {Promise<MakePurchaseResponse>} A [PurchasesError] is triggered after an error or when the user cancels the purchase.
* If user cancelled, userCancelled will be true
*/
@Cordova({
successIndex: 1,
errorIndex: 2,
observable: true,
})
makePurchase(
productIdentifier: string,
oldSKU?: string | null,
type: PURCHASE_TYPE = PURCHASE_TYPE.SUBS
): Promise<{ productIdentifier: string; purchaserInfo: PurchaserInfo }> {
return;
}

/**
* Make a purchase
*
Expand Down Expand Up @@ -479,11 +454,19 @@ export class Purchases extends IonicNativePlugin {
* This method will send all the purchases to the RevenueCat backend. Call this when using your own implementation
* for subscriptions anytime a sync is needed, like after a successful purchase.
*
* @warning This function should only be called if you're not calling makePurchase.
* @warning This function should only be called if you're not calling purchaseProduct.
*/
@Cordova({ sync: true })
syncPurchases(): void {}

/**
* iOS only. Presents a code redemption sheet, useful for redeeming offer codes
* Refer to https://docs.revenuecat.com/docs/ios-subscription-offers#offer-codes for more information on how
* to configure and use offer codes.
*/
@Cordova({ sync: true })
presentCodeRedemptionSheet(): void {}

/**
* Enable automatic collection of Apple Search Ads attribution. Disabled by default.
* @param {Boolean} enabled Enable or not automatic collection
Expand Down

0 comments on commit bed8797

Please sign in to comment.