@choochmeque/tauri-plugin-iap-api 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist-js/index.cjs +8 -3
- package/dist-js/index.d.ts +2 -2
- package/dist-js/index.js +8 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ⚠️ WARNING: WORK IS STILL IN PROGRESS. NOT READY FOR PRODUCTION YET
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
4
|

|
|
5
5
|
|
|
6
6
|
|
package/dist-js/index.cjs
CHANGED
|
@@ -14,16 +14,21 @@ async function getProducts(productIds, productType = 'subs') {
|
|
|
14
14
|
},
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
async function purchase(productId, offerToken) {
|
|
17
|
+
async function purchase(productId, productType = 'subs', offerToken) {
|
|
18
18
|
return await core.invoke('plugin:iap|purchase', {
|
|
19
19
|
payload: {
|
|
20
20
|
productId,
|
|
21
|
+
productType,
|
|
21
22
|
offerToken,
|
|
22
23
|
},
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
|
-
async function restorePurchases() {
|
|
26
|
-
return await core.invoke('plugin:iap|restore_purchases'
|
|
26
|
+
async function restorePurchases(productType = 'subs') {
|
|
27
|
+
return await core.invoke('plugin:iap|restore_purchases', {
|
|
28
|
+
payload: {
|
|
29
|
+
productType,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
27
32
|
}
|
|
28
33
|
async function getPurchaseHistory() {
|
|
29
34
|
return await core.invoke('plugin:iap|get_purchase_history');
|
package/dist-js/index.d.ts
CHANGED
|
@@ -59,8 +59,8 @@ export interface AcknowledgePurchaseResponse {
|
|
|
59
59
|
}
|
|
60
60
|
export declare function initialize(): Promise<InitializeResponse>;
|
|
61
61
|
export declare function getProducts(productIds: string[], productType?: 'subs' | 'inapp'): Promise<GetProductsResponse>;
|
|
62
|
-
export declare function purchase(productId: string, offerToken?: string): Promise<Purchase>;
|
|
63
|
-
export declare function restorePurchases(): Promise<RestorePurchasesResponse>;
|
|
62
|
+
export declare function purchase(productId: string, productType?: 'subs' | 'inapp', offerToken?: string): Promise<Purchase>;
|
|
63
|
+
export declare function restorePurchases(productType?: 'subs' | 'inapp'): Promise<RestorePurchasesResponse>;
|
|
64
64
|
export declare function getPurchaseHistory(): Promise<GetPurchaseHistoryResponse>;
|
|
65
65
|
export declare function acknowledgePurchase(purchaseToken: string): Promise<AcknowledgePurchaseResponse>;
|
|
66
66
|
export declare function onPurchaseUpdated(callback: (purchase: Purchase) => void): () => void;
|
package/dist-js/index.js
CHANGED
|
@@ -12,16 +12,21 @@ async function getProducts(productIds, productType = 'subs') {
|
|
|
12
12
|
},
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
async function purchase(productId, offerToken) {
|
|
15
|
+
async function purchase(productId, productType = 'subs', offerToken) {
|
|
16
16
|
return await invoke('plugin:iap|purchase', {
|
|
17
17
|
payload: {
|
|
18
18
|
productId,
|
|
19
|
+
productType,
|
|
19
20
|
offerToken,
|
|
20
21
|
},
|
|
21
22
|
});
|
|
22
23
|
}
|
|
23
|
-
async function restorePurchases() {
|
|
24
|
-
return await invoke('plugin:iap|restore_purchases'
|
|
24
|
+
async function restorePurchases(productType = 'subs') {
|
|
25
|
+
return await invoke('plugin:iap|restore_purchases', {
|
|
26
|
+
payload: {
|
|
27
|
+
productType,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
25
30
|
}
|
|
26
31
|
async function getPurchaseHistory() {
|
|
27
32
|
return await invoke('plugin:iap|get_purchase_history');
|