@virex-tech/paywallo-sdk 1.4.0 → 1.5.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/android/src/main/java/com/paywallo/sdk/PaywalloStoreKitModule.kt +17 -7
- package/dist/index.d.mts +12 -107
- package/dist/index.d.ts +12 -107
- package/dist/index.js +291 -287
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +287 -278
- package/dist/index.mjs.map +1 -1
- package/ios/PaywalloFBBridge.swift +1 -1
- package/ios/PaywalloStoreKit.swift +17 -1
- package/package.json +2 -2
|
@@ -20,8 +20,12 @@ class PaywalloStoreKit: NSObject {
|
|
|
20
20
|
|
|
21
21
|
private func startTransactionListener() {
|
|
22
22
|
updateListenerTask = Task { [weak self] in
|
|
23
|
-
for await
|
|
23
|
+
for await result in Transaction.updates {
|
|
24
24
|
guard let _ = self else { return }
|
|
25
|
+
if case .verified(let transaction) = result {
|
|
26
|
+
print("[Paywallo:StoreKit] Transaction update: \(transaction.productID) status=\(transaction.revocationDate != nil ? "revoked" : "active") id=\(transaction.id)")
|
|
27
|
+
await transaction.finish()
|
|
28
|
+
}
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
}
|
|
@@ -56,6 +60,18 @@ class PaywalloStoreKit: NSObject {
|
|
|
56
60
|
) {
|
|
57
61
|
Task {
|
|
58
62
|
do {
|
|
63
|
+
var clearedCount = 0
|
|
64
|
+
for await result in Transaction.unfinished {
|
|
65
|
+
if case .verified(let tx) = result {
|
|
66
|
+
print("[Paywallo:StoreKit] Clearing unfinished tx: \(tx.productID) id=\(tx.id)")
|
|
67
|
+
await tx.finish()
|
|
68
|
+
clearedCount += 1
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if clearedCount > 0 {
|
|
72
|
+
print("[Paywallo:StoreKit] Cleared \(clearedCount) unfinished transaction(s)")
|
|
73
|
+
}
|
|
74
|
+
|
|
59
75
|
let products = try await Product.products(for: [productId])
|
|
60
76
|
guard let product = products.first else {
|
|
61
77
|
reject("PRODUCT_NOT_FOUND", "Product \(productId) not found", nil)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@virex-tech/paywallo-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "SDK React Native para integração com Paywallo - Paywalls, Subscriptions e Analytics",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"expo-application": ">=5.0.0",
|
|
66
66
|
"expo-tracking-transparency": ">=0.5.0",
|
|
67
67
|
"react-native-device-info": ">=10.0.0",
|
|
68
|
-
"react-native-keychain": "
|
|
68
|
+
"react-native-keychain": "^10.0.0"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"react": ">=18.0.0 || >=19.0.0",
|