@choochmeque/tauri-plugin-iap-api 0.5.1 → 0.7.0
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 +5 -9
- package/dist-js/index.cjs +2 -9
- package/dist-js/index.d.ts +4 -9
- package/dist-js/index.js +2 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -10,7 +10,6 @@ A Tauri plugin for In-App Purchases (IAP) with support for subscriptions on iOS
|
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
|
|
13
|
-
- Initialize billing/store connection
|
|
14
13
|
- Query products and subscriptions with detailed pricing
|
|
15
14
|
- Purchase subscriptions with platform-specific features
|
|
16
15
|
- Restore previous purchases
|
|
@@ -46,7 +45,7 @@ Add the plugin to your Tauri project's `Cargo.toml`:
|
|
|
46
45
|
|
|
47
46
|
```toml
|
|
48
47
|
[dependencies]
|
|
49
|
-
tauri-plugin-iap = "0.
|
|
48
|
+
tauri-plugin-iap = "0.7"
|
|
50
49
|
```
|
|
51
50
|
|
|
52
51
|
Configure the plugin permissions in your `capabilities/default.json`:
|
|
@@ -74,7 +73,6 @@ fn main() {
|
|
|
74
73
|
|
|
75
74
|
An example application is available in the [`examples/iap-demo`](examples/iap-demo) directory. The example demonstrates all core IAP functionality with a UI:
|
|
76
75
|
|
|
77
|
-
- Initialize IAP connection
|
|
78
76
|
- Fetch and display products with pricing
|
|
79
77
|
- Purchase products and subscriptions
|
|
80
78
|
- Restore previous purchases
|
|
@@ -109,7 +107,6 @@ The example app provides a fully functional demo with inline documentation for e
|
|
|
109
107
|
|
|
110
108
|
```typescript
|
|
111
109
|
import {
|
|
112
|
-
initialize,
|
|
113
110
|
getProducts,
|
|
114
111
|
purchase,
|
|
115
112
|
restorePurchases,
|
|
@@ -119,9 +116,6 @@ import {
|
|
|
119
116
|
PurchaseState
|
|
120
117
|
} from '@choochmeque/tauri-plugin-iap-api';
|
|
121
118
|
|
|
122
|
-
// Initialize the billing client
|
|
123
|
-
await initialize();
|
|
124
|
-
|
|
125
119
|
// Get available products
|
|
126
120
|
const products = await getProducts(['subscription_id_1', 'subscription_id_2'], 'subs');
|
|
127
121
|
|
|
@@ -229,8 +223,10 @@ await listener.unregister();
|
|
|
229
223
|
|
|
230
224
|
## API Reference
|
|
231
225
|
|
|
232
|
-
### `initialize()`
|
|
233
|
-
|
|
226
|
+
### `initialize()` *(Deprecated)*
|
|
227
|
+
> **Deprecated**: This function is no longer needed and will be removed in a future major release. The billing client is now initialized automatically when the plugin loads.
|
|
228
|
+
|
|
229
|
+
Returns `{ success: true }` for backward compatibility.
|
|
234
230
|
|
|
235
231
|
### `getProducts(productIds: string[], productType: 'subs' | 'inapp')`
|
|
236
232
|
Fetches product details from the store.
|
package/dist-js/index.cjs
CHANGED
|
@@ -13,16 +13,9 @@ exports.PurchaseState = void 0;
|
|
|
13
13
|
})(exports.PurchaseState || (exports.PurchaseState = {}));
|
|
14
14
|
/**
|
|
15
15
|
* Initialize the IAP plugin.
|
|
16
|
-
* Must be called before any other IAP operations.
|
|
17
16
|
*
|
|
18
|
-
* @
|
|
19
|
-
* @
|
|
20
|
-
* ```typescript
|
|
21
|
-
* const result = await initialize();
|
|
22
|
-
* if (result.success) {
|
|
23
|
-
* console.log('IAP initialized successfully');
|
|
24
|
-
* }
|
|
25
|
-
* ```
|
|
17
|
+
* @deprecated This function is no longer needed. The billing client is now initialized automatically when the plugin loads. This function will be removed in the next major release.
|
|
18
|
+
* @returns Promise resolving to `{ success: true }` for backward compatibility
|
|
26
19
|
*/
|
|
27
20
|
async function initialize() {
|
|
28
21
|
return await core.invoke("plugin:iap|initialize");
|
package/dist-js/index.d.ts
CHANGED
|
@@ -78,6 +78,8 @@ export interface Purchase {
|
|
|
78
78
|
signature: string;
|
|
79
79
|
/** Original transaction ID. Used to link renewals and restores to the original purchase. (iOS/macOS only) */
|
|
80
80
|
originalId?: string;
|
|
81
|
+
/** JWS representation of the signed transaction for server-side validation. (iOS/macOS only) */
|
|
82
|
+
jwsRepresentation?: string;
|
|
81
83
|
}
|
|
82
84
|
/**
|
|
83
85
|
* Response containing restored purchases
|
|
@@ -144,16 +146,9 @@ export interface PurchaseOptions {
|
|
|
144
146
|
}
|
|
145
147
|
/**
|
|
146
148
|
* Initialize the IAP plugin.
|
|
147
|
-
* Must be called before any other IAP operations.
|
|
148
149
|
*
|
|
149
|
-
* @
|
|
150
|
-
* @
|
|
151
|
-
* ```typescript
|
|
152
|
-
* const result = await initialize();
|
|
153
|
-
* if (result.success) {
|
|
154
|
-
* console.log('IAP initialized successfully');
|
|
155
|
-
* }
|
|
156
|
-
* ```
|
|
150
|
+
* @deprecated This function is no longer needed. The billing client is now initialized automatically when the plugin loads. This function will be removed in the next major release.
|
|
151
|
+
* @returns Promise resolving to `{ success: true }` for backward compatibility
|
|
157
152
|
*/
|
|
158
153
|
export declare function initialize(): Promise<InitializeResponse>;
|
|
159
154
|
/**
|
package/dist-js/index.js
CHANGED
|
@@ -11,16 +11,9 @@ var PurchaseState;
|
|
|
11
11
|
})(PurchaseState || (PurchaseState = {}));
|
|
12
12
|
/**
|
|
13
13
|
* Initialize the IAP plugin.
|
|
14
|
-
* Must be called before any other IAP operations.
|
|
15
14
|
*
|
|
16
|
-
* @
|
|
17
|
-
* @
|
|
18
|
-
* ```typescript
|
|
19
|
-
* const result = await initialize();
|
|
20
|
-
* if (result.success) {
|
|
21
|
-
* console.log('IAP initialized successfully');
|
|
22
|
-
* }
|
|
23
|
-
* ```
|
|
15
|
+
* @deprecated This function is no longer needed. The billing client is now initialized automatically when the plugin loads. This function will be removed in the next major release.
|
|
16
|
+
* @returns Promise resolving to `{ success: true }` for backward compatibility
|
|
24
17
|
*/
|
|
25
18
|
async function initialize() {
|
|
26
19
|
return await invoke("plugin:iap|initialize");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@choochmeque/tauri-plugin-iap-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "You",
|
|
6
6
|
"description": "A Tauri v2 plugin that enables In-App Purchases (IAP)",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@vitest/coverage-v8": "^4.0.13",
|
|
41
41
|
"@vitest/ui": "^4.0.13",
|
|
42
42
|
"happy-dom": "^20.0.10",
|
|
43
|
-
"prettier": "3.
|
|
43
|
+
"prettier": "3.8.0",
|
|
44
44
|
"rollup": "^4.9.6",
|
|
45
45
|
"tslib": "^2.6.2",
|
|
46
46
|
"typescript": "^5.3.3",
|