@virex-tech/paywallo-sdk 1.4.0 → 1.4.1

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.
@@ -12,7 +12,7 @@ class PaywalloFBBridge: NSObject {
12
12
  reject: @escaping RCTPromiseRejectBlock
13
13
  ) {
14
14
  let id = AppEvents.shared.anonymousID
15
- guard let id = id, !id.isEmpty else {
15
+ if id.isEmpty {
16
16
  resolve(nil)
17
17
  return
18
18
  }
@@ -20,8 +20,12 @@ class PaywalloStoreKit: NSObject {
20
20
 
21
21
  private func startTransactionListener() {
22
22
  updateListenerTask = Task { [weak self] in
23
- for await _ in Transaction.updates {
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.4.0",
3
+ "version": "1.4.1",
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": ">=8.0.0"
68
+ "react-native-keychain": "^10.0.0"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "react": ">=18.0.0 || >=19.0.0",