react-native-iap 11.0.4 → 11.0.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.
@@ -7,7 +7,7 @@
7
7
 
8
8
  import Foundation
9
9
  import StoreKit
10
- @available(iOS 15.0, *)
10
+ @available(iOS 15.0, tvOS 15.0, *)
11
11
  func serialize(_ p: Product) -> [String: Any?] {
12
12
  return [
13
13
  "debugDescription": serializeDebug( p.debugDescription),
@@ -43,7 +43,7 @@ func serialize(_ e: Error?) -> [String: Any?]? {
43
43
  guard let e = e else {return nil}
44
44
  return ["localizedDescription": e.localizedDescription]
45
45
  }
46
- @available(iOS 15.0, *)
46
+ @available(iOS 15.0, tvOS 15.0, *)
47
47
  func serialize(_ si: Product.SubscriptionInfo?) -> [String: Any?]? {
48
48
  guard let si = si else {return nil}
49
49
  return [
@@ -53,13 +53,13 @@ func serialize(_ si: Product.SubscriptionInfo?) -> [String: Any?]? {
53
53
  "subscriptionPeriod": serialize(si.subscriptionPeriod)
54
54
  ]
55
55
  }
56
- @available(iOS 15.0, *)
56
+ @available(iOS 15.0, tvOS 15.0, *)
57
57
  func serialize(_ sp: Product.SubscriptionPeriod?) -> [String: Any?]? {
58
58
  guard let sp = sp else {return nil}
59
59
  return ["value": sp.value,
60
60
  "unit": serialize(sp.unit)]
61
61
  }
62
- @available(iOS 15.0, *)
62
+ @available(iOS 15.0, tvOS 15.0, *)
63
63
  func serialize(_ sp: Product.SubscriptionPeriod.Unit?) -> String? {
64
64
  guard let sp = sp else {return nil}
65
65
  switch sp {
@@ -72,7 +72,7 @@ func serialize(_ sp: Product.SubscriptionPeriod.Unit?) -> String? {
72
72
  }
73
73
  }
74
74
 
75
- @available(iOS 15.0, *)
75
+ @available(iOS 15.0, tvOS 15.0, *)
76
76
  func serialize(_ s: Product.SubscriptionInfo.Status?) -> [String: Any?]? {
77
77
  guard let s = s else {return nil}
78
78
  return ["state": serialize( s.state)
@@ -81,7 +81,7 @@ func serialize(_ s: Product.SubscriptionInfo.Status?) -> [String: Any?]? {
81
81
  ]
82
82
  }
83
83
 
84
- @available(iOS 15.0, *)
84
+ @available(iOS 15.0, tvOS 15.0, *)
85
85
  func serialize(_ rs: Product.SubscriptionInfo.RenewalState?) -> String? {
86
86
  guard let rs = rs else {return nil}
87
87
  switch rs {
@@ -95,14 +95,14 @@ func serialize(_ rs: Product.SubscriptionInfo.RenewalState?) -> String? {
95
95
  }
96
96
  }
97
97
 
98
- @available(iOS 15.0, *)
98
+ @available(iOS 15.0, tvOS 15.0, *)
99
99
  func serialize(_ ri: Product.SubscriptionInfo.RenewalInfo?) -> [String: Any?]? {
100
100
  guard let ri = ri else {return nil}
101
101
  return ["signedDate": ri.signedDate.millisecondsSince1970
102
102
  ]
103
103
  }
104
104
 
105
- @available(iOS 15.0, *)
105
+ @available(iOS 15.0, tvOS 15.0, *)
106
106
  func serialize(_ so: Product.SubscriptionOffer?) -> [String: Any?]? {
107
107
  guard let so = so else {return nil}
108
108
  return [
@@ -115,7 +115,7 @@ func serialize(_ so: Product.SubscriptionOffer?) -> [String: Any?]? {
115
115
  "type": serialize(so.type)
116
116
  ]
117
117
  }
118
- @available(iOS 15.0, *)
118
+ @available(iOS 15.0, tvOS 15.0, *)
119
119
  func serialize(_ pm: Product.SubscriptionOffer.PaymentMode?) -> String? {
120
120
  guard let pm = pm else {return nil}
121
121
  switch pm {
@@ -126,7 +126,7 @@ func serialize(_ pm: Product.SubscriptionOffer.PaymentMode?) -> String? {
126
126
  return nil
127
127
  }
128
128
  }
129
- @available(iOS 15.0, *)
129
+ @available(iOS 15.0, tvOS 15.0, *)
130
130
  func serialize(_ ot: Product.SubscriptionOffer.OfferType?) -> String? {
131
131
  guard let ot = ot else {return nil}
132
132
  switch ot {
@@ -136,7 +136,7 @@ func serialize(_ ot: Product.SubscriptionOffer.OfferType?) -> String? {
136
136
  return nil
137
137
  }
138
138
  }
139
- @available(iOS 15.0, *)
139
+ @available(iOS 15.0, tvOS 15.0, *)
140
140
  func serialize(_ t: Transaction) -> [String: Any?] {
141
141
  return ["appAccountToken": t.appAccountToken,
142
142
  "appBundleID": t.appBundleID,
@@ -163,7 +163,7 @@ func serialize(_ t: Transaction) -> [String: Any?] {
163
163
  "webOrderLineItemID": t.webOrderLineItemID
164
164
  ]
165
165
  }
166
- @available(iOS 15.0, *)
166
+ @available(iOS 15.0, tvOS 15.0, *)
167
167
  func serialize(_ ot: Transaction.OfferType?) -> String? {
168
168
  guard let ot = ot else {return nil}
169
169
  switch ot {
@@ -174,7 +174,7 @@ func serialize(_ ot: Transaction.OfferType?) -> String? {
174
174
  return nil
175
175
  }
176
176
  }
177
- @available(iOS 15.0, *)
177
+ @available(iOS 15.0, tvOS 15.0, *)
178
178
  func serialize(_ ot: Transaction.OwnershipType?) -> String? {
179
179
  guard let ot = ot else {return nil}
180
180
  switch ot {
@@ -184,7 +184,7 @@ func serialize(_ ot: Transaction.OwnershipType?) -> String? {
184
184
  return nil
185
185
  }
186
186
  }
187
- @available(iOS 15.0, *)
187
+ @available(iOS 15.0, tvOS 15.0, *)
188
188
  func serialize(_ pt: Product.ProductType?) -> String? {
189
189
  guard let pt = pt else {return nil}
190
190
  switch pt {
@@ -15,7 +15,7 @@ public func debugMessage(_ object: Any...) {
15
15
  }
16
16
  #endif
17
17
  }
18
- @available(iOS 15.0, *)
18
+ @available(iOS 15.0, tvOS 15.0, *)
19
19
  func checkVerified<T>(_ result: VerificationResult<T>) throws -> T {
20
20
  // Check whether the JWS passes StoreKit verification.
21
21
  switch result {
@@ -655,7 +655,7 @@ class RNIapIos: RCTEventEmitter, SKRequestDelegate, SKPaymentTransactionObserver
655
655
  itemType = "subs"
656
656
  }
657
657
  // More reliable way of determining a subs on newer iOS versions
658
- if #available(iOS 12.0, *) {
658
+ if #available(iOS 12.0, tvOS 12.0, *) {
659
659
  if product.subscriptionGroupIdentifier != nil {
660
660
  itemType = "subs"
661
661
  }
@@ -216,7 +216,7 @@ class RNIapIosSk2: RCTEventEmitter, Sk2Delegate {
216
216
 
217
217
  override init() {
218
218
  super.init()
219
- if #available(iOS 15.0, *) {
219
+ if #available(iOS 15.0, tvOS 15.0, *) {
220
220
  delegate = RNIapIosSk2iOS15(sendEvent: self.sendEvent)
221
221
  }
222
222
  }
@@ -363,7 +363,7 @@ class RNIapIosSk2: RCTEventEmitter, Sk2Delegate {
363
363
  }
364
364
  }
365
365
 
366
- @available(iOS 15.0, *)
366
+ @available(iOS 15.0, tvOS 15.0, *)
367
367
  class RNIapIosSk2iOS15: Sk2Delegate {
368
368
  private var hasListeners = false
369
369
  private var products: [String: Product]
@@ -807,7 +807,7 @@ class RNIapIosSk2iOS15: Sk2Delegate {
807
807
  SKPaymentQueue.default().presentCodeRedemptionSheet()
808
808
  resolve(nil)
809
809
  #else
810
- reject(standardErrorCode(2), "This method is not available on tvOS", nil)
810
+ reject(IapErrors.E_USER_CANCELLED, "This method is not available on tvOS", nil)
811
811
  #endif
812
812
  }
813
813
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-iap",
3
- "version": "11.0.4",
3
+ "version": "11.0.6",
4
4
  "description": "React Native In App Purchase Module.",
5
5
  "repository": "https://github.com/dooboolab/react-native-iap",
6
6
  "author": "dooboolab <support@dooboolab.com> (https://github.com/dooboolab)",