Namespace for the cordova-plugin-purchase plugin.
All classes, enumerations and variables defined by the plugin are in this namespace.
Throughout the documentation, in order to keep examples readable, we omit the CdvPurchase prefix.
CdvPurchase
When you see, for example ProductType.PAID_SUBSCRIPTION, it refers to CdvPurchase.ProductType.PAID_SUBSCRIPTION.
ProductType.PAID_SUBSCRIPTION
CdvPurchase.ProductType.PAID_SUBSCRIPTION
In your code, you should access members directly through the CdvPurchase namespace:
// Recommended approach (works reliably with minification)CdvPurchase.store.initialize();CdvPurchase.store.register({ id: 'my-product', type: CdvPurchase.ProductType.PAID_SUBSCRIPTION, platform: CdvPurchase.Platform.APPLE_APPSTORE}); Copy
// Recommended approach (works reliably with minification)CdvPurchase.store.initialize();CdvPurchase.store.register({ id: 'my-product', type: CdvPurchase.ProductType.PAID_SUBSCRIPTION, platform: CdvPurchase.Platform.APPLE_APPSTORE});
Note: Using destructuring with the namespace may cause issues with minification tools:
// NOT recommended - may cause issues with minification tools like Terserconst { store, ProductType, Platform, LogLevel } = CdvPurchase; Copy
// NOT recommended - may cause issues with minification tools like Terserconst { store, ProductType, Platform, LogLevel } = CdvPurchase;
Namespace for the cordova-plugin-purchase plugin.
All classes, enumerations and variables defined by the plugin are in this namespace.
Throughout the documentation, in order to keep examples readable, we omit the
CdvPurchase
prefix.When you see, for example
ProductType.PAID_SUBSCRIPTION
, it refers toCdvPurchase.ProductType.PAID_SUBSCRIPTION
.In your code, you should access members directly through the CdvPurchase namespace:
Note: Using destructuring with the namespace may cause issues with minification tools: