cordova-plugin-purchase
Advanced tools
Comparing version 10.6.1 to 11.0.0
@@ -0,20 +1,9 @@ | ||
### Observed behavior | ||
# !!! PLEASE USE IN SUBJECT [IOS] OR [ANDROID] AS PREFIX FOR YOUR ISSUE !!! | ||
_Include logs with `store.verbosity = store.DEBUG`_ | ||
### system info | ||
Please report your OS, OS version, Compiling System and Version, used Plugin Version and any helpful information that can help us to resolve the problem. | ||
In example: | ||
``` | ||
OSX Sierra 10.12.04 | ||
Cordova 7.0.1 // Phone Gap 3.19.2 etc. | ||
Device: iPhone iOS 10.3.2 // Android 7.1 | ||
Plugin Version: 6.0.0 | ||
``` | ||
### Expected behavior | ||
### Observed behavior | ||
### System Info | ||
### Steps to reproduce | ||
Output of `cordova info`. |
@@ -712,2 +712,3 @@ # API Documentation | ||
- `IMMEDIATE_WITH_TIME_PRORATION` - Replacement takes effect immediately, and the remaining time will be prorated and credited to the user. | ||
- `IMMEDIATE_AND_CHARGE_FULL_PRICE` - The subscription is upgraded or downgraded and the user is charged full price for the new entitlement immediately. The remaining value from the previous subscription is either carried over for the same entitlement, or prorated for time when switching to a different entitlement. | ||
- `discount`, a object that describes the discount to apply with the purchase (iOS only): | ||
@@ -1042,2 +1043,19 @@ - `id`, discount identifier | ||
``` | ||
## <a name="launchPriceChangeConfirmationFlow"></a>*store.launchPriceChangeConfirmationFlow(callback)* | ||
Android only: display a generic dialog notifying the user of a subscription price change. | ||
See https://developer.android.com/google/play/billing/subscriptions#price-change-communicate | ||
* This call does nothing on iOS and Microsoft UWP. | ||
##### example usage | ||
```js | ||
store.launchPriceChangeConfirmationFlow(function(status) { | ||
if (status === "OK") { /* approved */ } | ||
if (status === "UserCanceled") { /* dialog canceled by user */ } | ||
})); | ||
``` | ||
## *store.log* object | ||
@@ -1044,0 +1062,0 @@ ### `store.log.error(message)` |
{ | ||
"name": "cordova-plugin-purchase", | ||
"version": "10.6.1", | ||
"version": "11.0.0", | ||
"description": "Cordova Purchase plugin for iOS, Android, Windows (AppStore, Play, UWP)", | ||
@@ -5,0 +5,0 @@ "cordova": { |
@@ -87,3 +87,4 @@ /** | ||
| 'IMMEDIATE_WITHOUT_PRORATION' | ||
| 'DEFERRED'; | ||
| 'DEFERRED' | ||
| 'IMMEDIATE_AND_CHARGE_FULL_PRICE'; | ||
@@ -285,3 +286,3 @@ export interface IAdditionalData { | ||
validator: string | IValidator | IValidatorTarget; | ||
/** | ||
@@ -324,3 +325,3 @@ * Set to true to automatically clean up the queue of transactions. | ||
*/ | ||
get(id: string): IStoreProduct; | ||
get(id: string): IStoreProduct | undefined; | ||
@@ -417,2 +418,8 @@ /** Return all products member of a given subscription group. */ | ||
manageBilling(): void; | ||
/** Display a generic dialog notifying the user of a subscription price change. | ||
* | ||
* See https://developer.android.com/google/play/billing/subscriptions#price-change-communicate | ||
* | ||
* Note: This call does nothing on iOS and Microsoft UWP. */ | ||
launchPriceChangeConfirmationFlow(productId: string, callback: (status: 'UserCanceled' | 'OK' | 'UnknownProduct') => void): void; | ||
/** Redeems a promotional offer from within the app. | ||
@@ -419,0 +426,0 @@ * |
@@ -33,2 +33,3 @@ (function() { | ||
/// - `IMMEDIATE_WITH_TIME_PRORATION` - Replacement takes effect immediately, and the remaining time will be prorated and credited to the user. | ||
/// - `IMMEDIATE_AND_CHARGE_FULL_PRICE` - The subscription is upgraded or downgraded and the user is charged full price for the new entitlement immediately. The remaining value from the previous subscription is either carried over for the same entitlement, or prorated for time when switching to a different entitlement. | ||
/// - `discount`, a object that describes the discount to apply with the purchase (iOS only): | ||
@@ -35,0 +36,0 @@ /// - `id`, discount identifier |
@@ -498,2 +498,6 @@ /*global storekit */ | ||
store.launchPriceChangeConfirmationFlow = function(productId, callback) { | ||
callback('UserCanceled'); | ||
}; | ||
/// store.redeemCode({ type: 'subscription_offer_code' }); | ||
@@ -500,0 +504,0 @@ store.redeem = function() { |
@@ -481,2 +481,8 @@ (function() { | ||
// callback: function(status: "UserCanceled" | "OK" | "UnknownProduct") | ||
store.launchPriceChangeConfirmationFlow = function(productId, callback) { | ||
store.inappbilling.onPriceChangeConfirmationResult = callback; | ||
store.inappbilling.launchPriceChangeConfirmationFlow(productId); | ||
}; | ||
})(); |
@@ -85,2 +85,11 @@ /* | ||
} | ||
if (msg.type === "onPriceChangeConfirmationResultOK" && this.options.onPriceChangeConfirmationResult) { | ||
this.options.onPriceChangeConfirmationResult("OK"); | ||
} | ||
if (msg.type === "onPriceChangeConfirmationResultUserCanceled" && this.options.onPriceChangeConfirmationResult) { | ||
this.options.onPriceChangeConfirmationResult("UserCanceled"); | ||
} | ||
if (msg.type === "onPriceChangeConfirmationResultUnknownSku" && this.options.onPriceChangeConfirmationResult) { | ||
this.options.onPriceChangeConfirmationResult("UnknownProduct"); | ||
} | ||
}; | ||
@@ -144,2 +153,5 @@ InAppBilling.prototype.getPurchases = function (success, fail) { | ||
}; | ||
InAppBilling.prototype.launchPriceChangeConfirmationFlow = function(productId) { | ||
return cordova.exec(function(){}, function(){}, "InAppBillingPlugin", "launchPriceChangeConfirmationFlow", [productId]); | ||
}; | ||
@@ -146,0 +158,0 @@ // Generates a `fail` function that accepts an optional error code |
@@ -348,2 +348,20 @@ /// ### Philosophy | ||
/// | ||
/// ## <a name="launchPriceChangeConfirmationFlow"></a>*store.launchPriceChangeConfirmationFlow(callback)* | ||
/// | ||
/// Android only: display a generic dialog notifying the user of a subscription price change. | ||
/// | ||
/// See https://developer.android.com/google/play/billing/subscriptions#price-change-communicate | ||
/// | ||
/// * This call does nothing on iOS and Microsoft UWP. | ||
/// | ||
/// ##### example usage | ||
/// | ||
/// ```js | ||
/// store.launchPriceChangeConfirmationFlow(function(status) { | ||
/// if (status === "OK") { /* approved */ } | ||
/// if (status === "UserCanceled") { /* dialog canceled by user */ } | ||
/// })); | ||
/// ``` | ||
// #include "log.js" | ||
@@ -380,2 +398,2 @@ // #include "metadata.js" | ||
store.version = '10.6.1'; | ||
store.version = '11.0.0'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1106262
101
18343