@capgo/native-purchases 7.12.4 → 7.12.6
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
CHANGED
|
@@ -10,6 +10,20 @@
|
|
|
10
10
|
|
|
11
11
|
This plugin allows you to implement in-app purchases and subscriptions in your Capacitor app using native APIs.
|
|
12
12
|
|
|
13
|
+
## Why Native Purchases?
|
|
14
|
+
|
|
15
|
+
The only **free**, **battle-tested** in-app purchase plugin for Capacitor with full feature parity:
|
|
16
|
+
|
|
17
|
+
- **StoreKit 2 (iOS)** - Uses Apple's latest purchase APIs for iOS 15+
|
|
18
|
+
- **Google Play Billing 7.x (Android)** - Implements the newest billing library
|
|
19
|
+
- **Complete feature set** - In-app products AND subscriptions with base plans
|
|
20
|
+
- **Same JavaScript API** - Compatible interface with paid alternatives
|
|
21
|
+
- **Comprehensive validation** - Built-in receipt/token validation examples
|
|
22
|
+
- **Modern package management** - Supports both Swift Package Manager (SPM) and CocoaPods (SPM-ready for Capacitor 8)
|
|
23
|
+
- **Production-ready** - Extensive documentation, testing guides, refund handling
|
|
24
|
+
|
|
25
|
+
Perfect for apps monetizing through one-time purchases or recurring subscriptions.
|
|
26
|
+
|
|
13
27
|
## Documentation
|
|
14
28
|
|
|
15
29
|
The most complete doc is available here: https://capgo.app/docs/plugins/native-purchases/
|
|
@@ -39,7 +39,7 @@ import org.json.JSONArray;
|
|
|
39
39
|
@CapacitorPlugin(name = "NativePurchases")
|
|
40
40
|
public class NativePurchasesPlugin extends Plugin {
|
|
41
41
|
|
|
42
|
-
private final String
|
|
42
|
+
private final String pluginVersion = "7.12.6";
|
|
43
43
|
public static final String TAG = "NativePurchases";
|
|
44
44
|
private static final Phaser semaphoreReady = new Phaser(1);
|
|
45
45
|
private BillingClient billingClient;
|
|
@@ -289,8 +289,8 @@ public class NativePurchasesPlugin extends Plugin {
|
|
|
289
289
|
Log.d(TAG, "getPluginVersion() called");
|
|
290
290
|
try {
|
|
291
291
|
final JSObject ret = new JSObject();
|
|
292
|
-
ret.put("version", this.
|
|
293
|
-
Log.d(TAG, "Returning plugin version: " + this.
|
|
292
|
+
ret.put("version", this.pluginVersion);
|
|
293
|
+
Log.d(TAG, "Returning plugin version: " + this.pluginVersion);
|
|
294
294
|
call.resolve(ret);
|
|
295
295
|
} catch (final Exception e) {
|
|
296
296
|
Log.d(TAG, "Error getting plugin version: " + e.getMessage());
|
|
@@ -21,11 +21,11 @@ public class NativePurchasesPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
21
21
|
CAPPluginMethod(name: "manageSubscriptions", returnType: CAPPluginReturnPromise)
|
|
22
22
|
]
|
|
23
23
|
|
|
24
|
-
private let
|
|
24
|
+
private let pluginVersion: String = "7.12.6"
|
|
25
25
|
private var transactionUpdatesTask: Task<Void, Never>?
|
|
26
26
|
|
|
27
27
|
@objc func getPluginVersion(_ call: CAPPluginCall) {
|
|
28
|
-
call.resolve(["version": self.
|
|
28
|
+
call.resolve(["version": self.pluginVersion])
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
override public func load() {
|