@capgo/native-purchases 8.9.17 → 8.11.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 +69 -15
- package/android/src/main/java/ee/forgr/nativepurchases/BillingResponseCodes.java +53 -0
- package/android/src/main/java/ee/forgr/nativepurchases/NativePurchasesPlugin.java +621 -72
- package/android/src/main/java/ee/forgr/nativepurchases/SubscriptionOfferSelector.java +15 -0
- package/android/src/main/java/ee/forgr/nativepurchases/SubscriptionReplacementModes.java +69 -0
- package/dist/docs.json +77 -6
- package/dist/esm/definitions.d.ts +96 -7
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +7 -1
- package/dist/esm/web.js +4 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +4 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +4 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/NativePurchasesPlugin/NativePurchasesPlugin.swift +9 -2
- package/package.json +3 -2
|
@@ -23,10 +23,11 @@ public class NativePurchasesPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
23
23
|
CAPPluginMethod(name: "getStorefront", returnType: CAPPluginReturnPromise),
|
|
24
24
|
CAPPluginMethod(name: "configure", returnType: CAPPluginReturnPromise),
|
|
25
25
|
CAPPluginMethod(name: "getUnfinishedTransactions", returnType: CAPPluginReturnPromise),
|
|
26
|
-
CAPPluginMethod(name: "finishTransaction", returnType: CAPPluginReturnPromise)
|
|
26
|
+
CAPPluginMethod(name: "finishTransaction", returnType: CAPPluginReturnPromise),
|
|
27
|
+
CAPPluginMethod(name: "isSubscriptionReplacementSupported", returnType: CAPPluginReturnPromise)
|
|
27
28
|
]
|
|
28
29
|
|
|
29
|
-
private let pluginVersion: String = "8.
|
|
30
|
+
private let pluginVersion: String = "8.11.0"
|
|
30
31
|
var autoFinishTransactions: Bool = true
|
|
31
32
|
private var transactionUpdatesTask: Task<Void, Never>?
|
|
32
33
|
|
|
@@ -88,6 +89,12 @@ public class NativePurchasesPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
88
89
|
call.resolve(["isBillingSupported": true])
|
|
89
90
|
}
|
|
90
91
|
|
|
92
|
+
@objc func isSubscriptionReplacementSupported(_ call: CAPPluginCall) {
|
|
93
|
+
// StoreKit replaces a subscription when another product of the same subscription group is purchased;
|
|
94
|
+
// oldPurchaseToken / replacementMode are Android-only.
|
|
95
|
+
call.resolve(["supported": false])
|
|
96
|
+
}
|
|
97
|
+
|
|
91
98
|
@objc func getStorefront(_ call: CAPPluginCall) {
|
|
92
99
|
NativePurchasesLog.debug("getStorefront")
|
|
93
100
|
Task {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/native-purchases",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.11.0",
|
|
4
4
|
"description": "In-app Subscriptions Made Easy",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
"check:cap9-deprecated": "node scripts/check-cap9-deprecated.mjs",
|
|
54
54
|
"example:install": "cd example-app && bun install --frozen-lockfile",
|
|
55
55
|
"example:build": "bun run build && cd example-app && bun install --frozen-lockfile && bun run build",
|
|
56
|
-
"changelog:ai": "node scripts/generate-ai-changelog.mjs"
|
|
56
|
+
"changelog:ai": "node scripts/generate-ai-changelog.mjs",
|
|
57
|
+
"test:changelog": "node --test scripts/changelog-release-tags.test.mjs"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
60
|
"@capacitor/android": "^8.0.0",
|