add otherPromise option to decorator
This commit is contained in:
parent
f1988f67f5
commit
1e300ae35f
@ -6,8 +6,6 @@ import {Plugin, Cordova} from './plugin';
|
|||||||
* @description
|
* @description
|
||||||
* A lightweight Cordova plugin for in app purchases on iOS/Android.
|
* A lightweight Cordova plugin for in app purchases on iOS/Android.
|
||||||
*
|
*
|
||||||
* For more info, please see the [InAppPurchase plugin docs](https://github.com/AlexDisler/cordova-plugin-inapppurchase).
|
|
||||||
*
|
|
||||||
* @usage
|
* @usage
|
||||||
* ```ts
|
* ```ts
|
||||||
* import {InAppPurchase} from 'ionic-native';
|
* import {InAppPurchase} from 'ionic-native';
|
||||||
@ -55,7 +53,8 @@ import {Plugin, Cordova} from './plugin';
|
|||||||
@Plugin({
|
@Plugin({
|
||||||
plugin: 'cordova-plugin-inapppurchase',
|
plugin: 'cordova-plugin-inapppurchase',
|
||||||
pluginRef: 'inAppPurchase',
|
pluginRef: 'inAppPurchase',
|
||||||
platforms: ['Android', 'iOS']
|
platforms: ['Android', 'iOS'],
|
||||||
|
repo: 'https://github.com/AlexDisler/cordova-plugin-inapppurchase'
|
||||||
})
|
})
|
||||||
export class InAppPurchase {
|
export class InAppPurchase {
|
||||||
|
|
||||||
@ -64,15 +63,19 @@ export class InAppPurchase {
|
|||||||
* @param {array<string>} productId an array of product ids.
|
* @param {array<string>} productId an array of product ids.
|
||||||
* @returns {Promise} Returns a Promise that resolves with an array of objects.
|
* @returns {Promise} Returns a Promise that resolves with an array of objects.
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova({
|
||||||
static getProducts(productId: array<string>): Promise<any> { return; }
|
otherPromise: true
|
||||||
|
})
|
||||||
|
static getProducts(productId: string[]): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Buy a product that matches the productId.
|
* Buy a product that matches the productId.
|
||||||
* @param {string} productId A string that matches the product you want to buy.
|
* @param {string} productId A string that matches the product you want to buy.
|
||||||
* @returns {Promise} Returns a Promise that resolves with the transaction details.
|
* @returns {Promise} Returns a Promise that resolves with the transaction details.
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova({
|
||||||
|
otherPromise: true
|
||||||
|
})
|
||||||
static buy(productId: string): Promise<{transactionId: string, receipt: string, signature: string, productType: string}> { return; }
|
static buy(productId: string): Promise<{transactionId: string, receipt: string, signature: string, productType: string}> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -80,7 +83,9 @@ export class InAppPurchase {
|
|||||||
* @param {string} productId A string that matches the product you want to subscribe to.
|
* @param {string} productId A string that matches the product you want to subscribe to.
|
||||||
* @returns {Promise} Returns a Promise that resolves with the transaction details.
|
* @returns {Promise} Returns a Promise that resolves with the transaction details.
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova({
|
||||||
|
otherPromise: true
|
||||||
|
})
|
||||||
static subscribe(productId: string): Promise<{transactionId: string, receipt: string, signature: string, productType: string}> { return; }
|
static subscribe(productId: string): Promise<{transactionId: string, receipt: string, signature: string, productType: string}> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -89,21 +94,28 @@ export class InAppPurchase {
|
|||||||
* @param {string} receipt
|
* @param {string} receipt
|
||||||
* @param {string} signature
|
* @param {string} signature
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova({
|
||||||
static consume(productType: string, receipt: string, signature: string): void { }
|
otherPromise: true
|
||||||
|
})
|
||||||
|
static consume(productType: string, receipt: string, signature: string): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Restore all purchases from the store
|
* Restore all purchases from the store
|
||||||
* @returns {Promise} Returns a promise with an array of purchases.
|
* @returns {Promise} Returns a promise with an array of purchases.
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova({
|
||||||
|
otherPromise: true
|
||||||
|
})
|
||||||
static restorePurchases(): Promise<any> { return; }
|
static restorePurchases(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the receipt.
|
* Get the receipt.
|
||||||
* @returns {Promise<string>} Returns a promise that contains the string for the receipt
|
* @returns {Promise<string>} Returns a promise that contains the string for the receipt
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova({
|
||||||
|
otherPromise: true,
|
||||||
|
platforms: ['iOS']
|
||||||
|
})
|
||||||
static getReceipt(): Promise<string> { return; }
|
static getReceipt(): Promise<string> { return; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user