react-native-iap 14.4.16 → 14.4.17
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/margelo/nitro/iap/HybridRnIap.kt +55 -0
- package/ios/HybridRnIap.swift +17 -0
- package/ios/RnIapHelper.swift +45 -0
- package/lib/module/index.js +123 -33
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js +5 -0
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/index.d.ts +9 -6
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/RnIap.nitro.d.ts +41 -1
- package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +47 -0
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +45 -0
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.hpp +1 -0
- package/nitrogen/generated/android/c++/JNitroActiveSubscription.hpp +108 -0
- package/nitrogen/generated/android/c++/JNitroRenewalInfoIOS.hpp +90 -0
- package/nitrogen/generated/android/c++/JPurchase.hpp +2 -0
- package/nitrogen/generated/android/c++/JPurchaseIOS.hpp +6 -0
- package/nitrogen/generated/android/c++/JRenewalInfoIOS.hpp +94 -0
- package/nitrogen/generated/android/c++/JRequestPurchaseResult.hpp +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +4 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroActiveSubscription.kt +68 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRenewalInfoIOS.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseIOS.kt +3 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/RenewalInfoIOS.kt +59 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.cpp +8 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +93 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +9 -0
- package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +17 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_NitroActiveSubscription_.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +1 -0
- package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +32 -0
- package/nitrogen/generated/ios/swift/NitroActiveSubscription.swift +340 -0
- package/nitrogen/generated/ios/swift/NitroRenewalInfoIOS.swift +296 -0
- package/nitrogen/generated/ios/swift/PurchaseIOS.swift +31 -1
- package/nitrogen/generated/ios/swift/RenewalInfoIOS.swift +314 -0
- package/nitrogen/generated/shared/c++/HybridRnIapSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridRnIapSpec.hpp +4 -0
- package/nitrogen/generated/shared/c++/NitroActiveSubscription.hpp +122 -0
- package/nitrogen/generated/shared/c++/NitroRenewalInfoIOS.hpp +104 -0
- package/nitrogen/generated/shared/c++/PurchaseIOS.hpp +8 -1
- package/nitrogen/generated/shared/c++/RenewalInfoIOS.hpp +108 -0
- package/openiap-versions.json +3 -3
- package/package.json +1 -1
- package/src/index.ts +87 -4
- package/src/specs/RnIap.nitro.ts +48 -0
- package/src/types.ts +47 -0
|
@@ -258,6 +258,38 @@ open class HybridRnIapSpec_cxx {
|
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
+
@inline(__always)
|
|
262
|
+
public final func getActiveSubscriptions(subscriptionIds: bridge.std__optional_std__vector_std__string__) -> bridge.Result_std__shared_ptr_Promise_std__vector_NitroActiveSubscription____ {
|
|
263
|
+
do {
|
|
264
|
+
let __result = try self.__implementation.getActiveSubscriptions(subscriptionIds: { () -> [String]? in
|
|
265
|
+
if bridge.has_value_std__optional_std__vector_std__string__(subscriptionIds) {
|
|
266
|
+
let __unwrapped = bridge.get_std__optional_std__vector_std__string__(subscriptionIds)
|
|
267
|
+
return __unwrapped.map({ __item in String(__item) })
|
|
268
|
+
} else {
|
|
269
|
+
return nil
|
|
270
|
+
}
|
|
271
|
+
}())
|
|
272
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_NitroActiveSubscription___ in
|
|
273
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__vector_NitroActiveSubscription___()
|
|
274
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_NitroActiveSubscription___(__promise)
|
|
275
|
+
__result
|
|
276
|
+
.then({ __result in __promiseHolder.resolve({ () -> bridge.std__vector_NitroActiveSubscription_ in
|
|
277
|
+
var __vector = bridge.create_std__vector_NitroActiveSubscription_(__result.count)
|
|
278
|
+
for __item in __result {
|
|
279
|
+
__vector.push_back(__item)
|
|
280
|
+
}
|
|
281
|
+
return __vector
|
|
282
|
+
}()) })
|
|
283
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
284
|
+
return __promise
|
|
285
|
+
}()
|
|
286
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__vector_NitroActiveSubscription____(__resultCpp)
|
|
287
|
+
} catch (let __error) {
|
|
288
|
+
let __exceptionPtr = __error.toCpp()
|
|
289
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__vector_NitroActiveSubscription____(__exceptionPtr)
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
261
293
|
@inline(__always)
|
|
262
294
|
public final func finishTransaction(params: NitroFinishTransactionParams) -> bridge.Result_std__shared_ptr_Promise_std__variant_bool__NitroPurchaseResult____ {
|
|
263
295
|
do {
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroActiveSubscription.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `NitroActiveSubscription`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias NitroActiveSubscription = margelo.nitro.iap.NitroActiveSubscription
|
|
14
|
+
|
|
15
|
+
public extension NitroActiveSubscription {
|
|
16
|
+
private typealias bridge = margelo.nitro.iap.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `NitroActiveSubscription`.
|
|
20
|
+
*/
|
|
21
|
+
init(productId: String, isActive: Bool, transactionId: String, purchaseToken: String?, transactionDate: Double, expirationDateIOS: Double?, environmentIOS: String?, willExpireSoon: Bool?, daysUntilExpirationIOS: Double?, renewalInfoIOS: NitroRenewalInfoIOS?, autoRenewingAndroid: Bool?, basePlanIdAndroid: String?, currentPlanId: String?, purchaseTokenAndroid: String?) {
|
|
22
|
+
self.init(std.string(productId), isActive, std.string(transactionId), { () -> bridge.std__optional_std__string_ in
|
|
23
|
+
if let __unwrappedValue = purchaseToken {
|
|
24
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), transactionDate, { () -> bridge.std__optional_double_ in
|
|
29
|
+
if let __unwrappedValue = expirationDateIOS {
|
|
30
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
34
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
35
|
+
if let __unwrappedValue = environmentIOS {
|
|
36
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
37
|
+
} else {
|
|
38
|
+
return .init()
|
|
39
|
+
}
|
|
40
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
41
|
+
if let __unwrappedValue = willExpireSoon {
|
|
42
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
43
|
+
} else {
|
|
44
|
+
return .init()
|
|
45
|
+
}
|
|
46
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
47
|
+
if let __unwrappedValue = daysUntilExpirationIOS {
|
|
48
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
49
|
+
} else {
|
|
50
|
+
return .init()
|
|
51
|
+
}
|
|
52
|
+
}(), { () -> bridge.std__optional_NitroRenewalInfoIOS_ in
|
|
53
|
+
if let __unwrappedValue = renewalInfoIOS {
|
|
54
|
+
return bridge.create_std__optional_NitroRenewalInfoIOS_(__unwrappedValue)
|
|
55
|
+
} else {
|
|
56
|
+
return .init()
|
|
57
|
+
}
|
|
58
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
59
|
+
if let __unwrappedValue = autoRenewingAndroid {
|
|
60
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
61
|
+
} else {
|
|
62
|
+
return .init()
|
|
63
|
+
}
|
|
64
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
65
|
+
if let __unwrappedValue = basePlanIdAndroid {
|
|
66
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
67
|
+
} else {
|
|
68
|
+
return .init()
|
|
69
|
+
}
|
|
70
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
71
|
+
if let __unwrappedValue = currentPlanId {
|
|
72
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
73
|
+
} else {
|
|
74
|
+
return .init()
|
|
75
|
+
}
|
|
76
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
77
|
+
if let __unwrappedValue = purchaseTokenAndroid {
|
|
78
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
79
|
+
} else {
|
|
80
|
+
return .init()
|
|
81
|
+
}
|
|
82
|
+
}())
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
var productId: String {
|
|
86
|
+
@inline(__always)
|
|
87
|
+
get {
|
|
88
|
+
return String(self.__productId)
|
|
89
|
+
}
|
|
90
|
+
@inline(__always)
|
|
91
|
+
set {
|
|
92
|
+
self.__productId = std.string(newValue)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
var isActive: Bool {
|
|
97
|
+
@inline(__always)
|
|
98
|
+
get {
|
|
99
|
+
return self.__isActive
|
|
100
|
+
}
|
|
101
|
+
@inline(__always)
|
|
102
|
+
set {
|
|
103
|
+
self.__isActive = newValue
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
var transactionId: String {
|
|
108
|
+
@inline(__always)
|
|
109
|
+
get {
|
|
110
|
+
return String(self.__transactionId)
|
|
111
|
+
}
|
|
112
|
+
@inline(__always)
|
|
113
|
+
set {
|
|
114
|
+
self.__transactionId = std.string(newValue)
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
var purchaseToken: String? {
|
|
119
|
+
@inline(__always)
|
|
120
|
+
get {
|
|
121
|
+
return { () -> String? in
|
|
122
|
+
if bridge.has_value_std__optional_std__string_(self.__purchaseToken) {
|
|
123
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__purchaseToken)
|
|
124
|
+
return String(__unwrapped)
|
|
125
|
+
} else {
|
|
126
|
+
return nil
|
|
127
|
+
}
|
|
128
|
+
}()
|
|
129
|
+
}
|
|
130
|
+
@inline(__always)
|
|
131
|
+
set {
|
|
132
|
+
self.__purchaseToken = { () -> bridge.std__optional_std__string_ in
|
|
133
|
+
if let __unwrappedValue = newValue {
|
|
134
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
135
|
+
} else {
|
|
136
|
+
return .init()
|
|
137
|
+
}
|
|
138
|
+
}()
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
var transactionDate: Double {
|
|
143
|
+
@inline(__always)
|
|
144
|
+
get {
|
|
145
|
+
return self.__transactionDate
|
|
146
|
+
}
|
|
147
|
+
@inline(__always)
|
|
148
|
+
set {
|
|
149
|
+
self.__transactionDate = newValue
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
var expirationDateIOS: Double? {
|
|
154
|
+
@inline(__always)
|
|
155
|
+
get {
|
|
156
|
+
return self.__expirationDateIOS.value
|
|
157
|
+
}
|
|
158
|
+
@inline(__always)
|
|
159
|
+
set {
|
|
160
|
+
self.__expirationDateIOS = { () -> bridge.std__optional_double_ in
|
|
161
|
+
if let __unwrappedValue = newValue {
|
|
162
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
163
|
+
} else {
|
|
164
|
+
return .init()
|
|
165
|
+
}
|
|
166
|
+
}()
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
var environmentIOS: String? {
|
|
171
|
+
@inline(__always)
|
|
172
|
+
get {
|
|
173
|
+
return { () -> String? in
|
|
174
|
+
if bridge.has_value_std__optional_std__string_(self.__environmentIOS) {
|
|
175
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__environmentIOS)
|
|
176
|
+
return String(__unwrapped)
|
|
177
|
+
} else {
|
|
178
|
+
return nil
|
|
179
|
+
}
|
|
180
|
+
}()
|
|
181
|
+
}
|
|
182
|
+
@inline(__always)
|
|
183
|
+
set {
|
|
184
|
+
self.__environmentIOS = { () -> bridge.std__optional_std__string_ in
|
|
185
|
+
if let __unwrappedValue = newValue {
|
|
186
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
187
|
+
} else {
|
|
188
|
+
return .init()
|
|
189
|
+
}
|
|
190
|
+
}()
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
var willExpireSoon: Bool? {
|
|
195
|
+
@inline(__always)
|
|
196
|
+
get {
|
|
197
|
+
return self.__willExpireSoon.value
|
|
198
|
+
}
|
|
199
|
+
@inline(__always)
|
|
200
|
+
set {
|
|
201
|
+
self.__willExpireSoon = { () -> bridge.std__optional_bool_ in
|
|
202
|
+
if let __unwrappedValue = newValue {
|
|
203
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
204
|
+
} else {
|
|
205
|
+
return .init()
|
|
206
|
+
}
|
|
207
|
+
}()
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
var daysUntilExpirationIOS: Double? {
|
|
212
|
+
@inline(__always)
|
|
213
|
+
get {
|
|
214
|
+
return self.__daysUntilExpirationIOS.value
|
|
215
|
+
}
|
|
216
|
+
@inline(__always)
|
|
217
|
+
set {
|
|
218
|
+
self.__daysUntilExpirationIOS = { () -> bridge.std__optional_double_ in
|
|
219
|
+
if let __unwrappedValue = newValue {
|
|
220
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
221
|
+
} else {
|
|
222
|
+
return .init()
|
|
223
|
+
}
|
|
224
|
+
}()
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
var renewalInfoIOS: NitroRenewalInfoIOS? {
|
|
229
|
+
@inline(__always)
|
|
230
|
+
get {
|
|
231
|
+
return { () -> NitroRenewalInfoIOS? in
|
|
232
|
+
if bridge.has_value_std__optional_NitroRenewalInfoIOS_(self.__renewalInfoIOS) {
|
|
233
|
+
let __unwrapped = bridge.get_std__optional_NitroRenewalInfoIOS_(self.__renewalInfoIOS)
|
|
234
|
+
return __unwrapped
|
|
235
|
+
} else {
|
|
236
|
+
return nil
|
|
237
|
+
}
|
|
238
|
+
}()
|
|
239
|
+
}
|
|
240
|
+
@inline(__always)
|
|
241
|
+
set {
|
|
242
|
+
self.__renewalInfoIOS = { () -> bridge.std__optional_NitroRenewalInfoIOS_ in
|
|
243
|
+
if let __unwrappedValue = newValue {
|
|
244
|
+
return bridge.create_std__optional_NitroRenewalInfoIOS_(__unwrappedValue)
|
|
245
|
+
} else {
|
|
246
|
+
return .init()
|
|
247
|
+
}
|
|
248
|
+
}()
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
var autoRenewingAndroid: Bool? {
|
|
253
|
+
@inline(__always)
|
|
254
|
+
get {
|
|
255
|
+
return self.__autoRenewingAndroid.value
|
|
256
|
+
}
|
|
257
|
+
@inline(__always)
|
|
258
|
+
set {
|
|
259
|
+
self.__autoRenewingAndroid = { () -> bridge.std__optional_bool_ in
|
|
260
|
+
if let __unwrappedValue = newValue {
|
|
261
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
262
|
+
} else {
|
|
263
|
+
return .init()
|
|
264
|
+
}
|
|
265
|
+
}()
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
var basePlanIdAndroid: String? {
|
|
270
|
+
@inline(__always)
|
|
271
|
+
get {
|
|
272
|
+
return { () -> String? in
|
|
273
|
+
if bridge.has_value_std__optional_std__string_(self.__basePlanIdAndroid) {
|
|
274
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__basePlanIdAndroid)
|
|
275
|
+
return String(__unwrapped)
|
|
276
|
+
} else {
|
|
277
|
+
return nil
|
|
278
|
+
}
|
|
279
|
+
}()
|
|
280
|
+
}
|
|
281
|
+
@inline(__always)
|
|
282
|
+
set {
|
|
283
|
+
self.__basePlanIdAndroid = { () -> bridge.std__optional_std__string_ in
|
|
284
|
+
if let __unwrappedValue = newValue {
|
|
285
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
286
|
+
} else {
|
|
287
|
+
return .init()
|
|
288
|
+
}
|
|
289
|
+
}()
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
var currentPlanId: String? {
|
|
294
|
+
@inline(__always)
|
|
295
|
+
get {
|
|
296
|
+
return { () -> String? in
|
|
297
|
+
if bridge.has_value_std__optional_std__string_(self.__currentPlanId) {
|
|
298
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__currentPlanId)
|
|
299
|
+
return String(__unwrapped)
|
|
300
|
+
} else {
|
|
301
|
+
return nil
|
|
302
|
+
}
|
|
303
|
+
}()
|
|
304
|
+
}
|
|
305
|
+
@inline(__always)
|
|
306
|
+
set {
|
|
307
|
+
self.__currentPlanId = { () -> bridge.std__optional_std__string_ in
|
|
308
|
+
if let __unwrappedValue = newValue {
|
|
309
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
310
|
+
} else {
|
|
311
|
+
return .init()
|
|
312
|
+
}
|
|
313
|
+
}()
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
var purchaseTokenAndroid: String? {
|
|
318
|
+
@inline(__always)
|
|
319
|
+
get {
|
|
320
|
+
return { () -> String? in
|
|
321
|
+
if bridge.has_value_std__optional_std__string_(self.__purchaseTokenAndroid) {
|
|
322
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__purchaseTokenAndroid)
|
|
323
|
+
return String(__unwrapped)
|
|
324
|
+
} else {
|
|
325
|
+
return nil
|
|
326
|
+
}
|
|
327
|
+
}()
|
|
328
|
+
}
|
|
329
|
+
@inline(__always)
|
|
330
|
+
set {
|
|
331
|
+
self.__purchaseTokenAndroid = { () -> bridge.std__optional_std__string_ in
|
|
332
|
+
if let __unwrappedValue = newValue {
|
|
333
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
334
|
+
} else {
|
|
335
|
+
return .init()
|
|
336
|
+
}
|
|
337
|
+
}()
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroRenewalInfoIOS.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `NitroRenewalInfoIOS`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias NitroRenewalInfoIOS = margelo.nitro.iap.NitroRenewalInfoIOS
|
|
14
|
+
|
|
15
|
+
public extension NitroRenewalInfoIOS {
|
|
16
|
+
private typealias bridge = margelo.nitro.iap.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `NitroRenewalInfoIOS`.
|
|
20
|
+
*/
|
|
21
|
+
init(willAutoRenew: Bool?, autoRenewPreference: String?, pendingUpgradeProductId: String?, renewalDate: Double?, expirationReason: String?, isInBillingRetry: Bool?, gracePeriodExpirationDate: Double?, priceIncreaseStatus: String?, offerType: String?, offerIdentifier: String?) {
|
|
22
|
+
self.init({ () -> bridge.std__optional_bool_ in
|
|
23
|
+
if let __unwrappedValue = willAutoRenew {
|
|
24
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
29
|
+
if let __unwrappedValue = autoRenewPreference {
|
|
30
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
34
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
35
|
+
if let __unwrappedValue = pendingUpgradeProductId {
|
|
36
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
37
|
+
} else {
|
|
38
|
+
return .init()
|
|
39
|
+
}
|
|
40
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
41
|
+
if let __unwrappedValue = renewalDate {
|
|
42
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
43
|
+
} else {
|
|
44
|
+
return .init()
|
|
45
|
+
}
|
|
46
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
47
|
+
if let __unwrappedValue = expirationReason {
|
|
48
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
49
|
+
} else {
|
|
50
|
+
return .init()
|
|
51
|
+
}
|
|
52
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
53
|
+
if let __unwrappedValue = isInBillingRetry {
|
|
54
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
55
|
+
} else {
|
|
56
|
+
return .init()
|
|
57
|
+
}
|
|
58
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
59
|
+
if let __unwrappedValue = gracePeriodExpirationDate {
|
|
60
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
61
|
+
} else {
|
|
62
|
+
return .init()
|
|
63
|
+
}
|
|
64
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
65
|
+
if let __unwrappedValue = priceIncreaseStatus {
|
|
66
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
67
|
+
} else {
|
|
68
|
+
return .init()
|
|
69
|
+
}
|
|
70
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
71
|
+
if let __unwrappedValue = offerType {
|
|
72
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
73
|
+
} else {
|
|
74
|
+
return .init()
|
|
75
|
+
}
|
|
76
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
77
|
+
if let __unwrappedValue = offerIdentifier {
|
|
78
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
79
|
+
} else {
|
|
80
|
+
return .init()
|
|
81
|
+
}
|
|
82
|
+
}())
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
var willAutoRenew: Bool? {
|
|
86
|
+
@inline(__always)
|
|
87
|
+
get {
|
|
88
|
+
return self.__willAutoRenew.value
|
|
89
|
+
}
|
|
90
|
+
@inline(__always)
|
|
91
|
+
set {
|
|
92
|
+
self.__willAutoRenew = { () -> bridge.std__optional_bool_ in
|
|
93
|
+
if let __unwrappedValue = newValue {
|
|
94
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
95
|
+
} else {
|
|
96
|
+
return .init()
|
|
97
|
+
}
|
|
98
|
+
}()
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
var autoRenewPreference: String? {
|
|
103
|
+
@inline(__always)
|
|
104
|
+
get {
|
|
105
|
+
return { () -> String? in
|
|
106
|
+
if bridge.has_value_std__optional_std__string_(self.__autoRenewPreference) {
|
|
107
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__autoRenewPreference)
|
|
108
|
+
return String(__unwrapped)
|
|
109
|
+
} else {
|
|
110
|
+
return nil
|
|
111
|
+
}
|
|
112
|
+
}()
|
|
113
|
+
}
|
|
114
|
+
@inline(__always)
|
|
115
|
+
set {
|
|
116
|
+
self.__autoRenewPreference = { () -> bridge.std__optional_std__string_ in
|
|
117
|
+
if let __unwrappedValue = newValue {
|
|
118
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
119
|
+
} else {
|
|
120
|
+
return .init()
|
|
121
|
+
}
|
|
122
|
+
}()
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
var pendingUpgradeProductId: String? {
|
|
127
|
+
@inline(__always)
|
|
128
|
+
get {
|
|
129
|
+
return { () -> String? in
|
|
130
|
+
if bridge.has_value_std__optional_std__string_(self.__pendingUpgradeProductId) {
|
|
131
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__pendingUpgradeProductId)
|
|
132
|
+
return String(__unwrapped)
|
|
133
|
+
} else {
|
|
134
|
+
return nil
|
|
135
|
+
}
|
|
136
|
+
}()
|
|
137
|
+
}
|
|
138
|
+
@inline(__always)
|
|
139
|
+
set {
|
|
140
|
+
self.__pendingUpgradeProductId = { () -> bridge.std__optional_std__string_ in
|
|
141
|
+
if let __unwrappedValue = newValue {
|
|
142
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
143
|
+
} else {
|
|
144
|
+
return .init()
|
|
145
|
+
}
|
|
146
|
+
}()
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
var renewalDate: Double? {
|
|
151
|
+
@inline(__always)
|
|
152
|
+
get {
|
|
153
|
+
return self.__renewalDate.value
|
|
154
|
+
}
|
|
155
|
+
@inline(__always)
|
|
156
|
+
set {
|
|
157
|
+
self.__renewalDate = { () -> bridge.std__optional_double_ in
|
|
158
|
+
if let __unwrappedValue = newValue {
|
|
159
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
160
|
+
} else {
|
|
161
|
+
return .init()
|
|
162
|
+
}
|
|
163
|
+
}()
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
var expirationReason: String? {
|
|
168
|
+
@inline(__always)
|
|
169
|
+
get {
|
|
170
|
+
return { () -> String? in
|
|
171
|
+
if bridge.has_value_std__optional_std__string_(self.__expirationReason) {
|
|
172
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__expirationReason)
|
|
173
|
+
return String(__unwrapped)
|
|
174
|
+
} else {
|
|
175
|
+
return nil
|
|
176
|
+
}
|
|
177
|
+
}()
|
|
178
|
+
}
|
|
179
|
+
@inline(__always)
|
|
180
|
+
set {
|
|
181
|
+
self.__expirationReason = { () -> bridge.std__optional_std__string_ in
|
|
182
|
+
if let __unwrappedValue = newValue {
|
|
183
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
184
|
+
} else {
|
|
185
|
+
return .init()
|
|
186
|
+
}
|
|
187
|
+
}()
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
var isInBillingRetry: Bool? {
|
|
192
|
+
@inline(__always)
|
|
193
|
+
get {
|
|
194
|
+
return self.__isInBillingRetry.value
|
|
195
|
+
}
|
|
196
|
+
@inline(__always)
|
|
197
|
+
set {
|
|
198
|
+
self.__isInBillingRetry = { () -> bridge.std__optional_bool_ in
|
|
199
|
+
if let __unwrappedValue = newValue {
|
|
200
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
201
|
+
} else {
|
|
202
|
+
return .init()
|
|
203
|
+
}
|
|
204
|
+
}()
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
var gracePeriodExpirationDate: Double? {
|
|
209
|
+
@inline(__always)
|
|
210
|
+
get {
|
|
211
|
+
return self.__gracePeriodExpirationDate.value
|
|
212
|
+
}
|
|
213
|
+
@inline(__always)
|
|
214
|
+
set {
|
|
215
|
+
self.__gracePeriodExpirationDate = { () -> bridge.std__optional_double_ in
|
|
216
|
+
if let __unwrappedValue = newValue {
|
|
217
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
218
|
+
} else {
|
|
219
|
+
return .init()
|
|
220
|
+
}
|
|
221
|
+
}()
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
var priceIncreaseStatus: String? {
|
|
226
|
+
@inline(__always)
|
|
227
|
+
get {
|
|
228
|
+
return { () -> String? in
|
|
229
|
+
if bridge.has_value_std__optional_std__string_(self.__priceIncreaseStatus) {
|
|
230
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__priceIncreaseStatus)
|
|
231
|
+
return String(__unwrapped)
|
|
232
|
+
} else {
|
|
233
|
+
return nil
|
|
234
|
+
}
|
|
235
|
+
}()
|
|
236
|
+
}
|
|
237
|
+
@inline(__always)
|
|
238
|
+
set {
|
|
239
|
+
self.__priceIncreaseStatus = { () -> bridge.std__optional_std__string_ in
|
|
240
|
+
if let __unwrappedValue = newValue {
|
|
241
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
242
|
+
} else {
|
|
243
|
+
return .init()
|
|
244
|
+
}
|
|
245
|
+
}()
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
var offerType: String? {
|
|
250
|
+
@inline(__always)
|
|
251
|
+
get {
|
|
252
|
+
return { () -> String? in
|
|
253
|
+
if bridge.has_value_std__optional_std__string_(self.__offerType) {
|
|
254
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__offerType)
|
|
255
|
+
return String(__unwrapped)
|
|
256
|
+
} else {
|
|
257
|
+
return nil
|
|
258
|
+
}
|
|
259
|
+
}()
|
|
260
|
+
}
|
|
261
|
+
@inline(__always)
|
|
262
|
+
set {
|
|
263
|
+
self.__offerType = { () -> bridge.std__optional_std__string_ in
|
|
264
|
+
if let __unwrappedValue = newValue {
|
|
265
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
266
|
+
} else {
|
|
267
|
+
return .init()
|
|
268
|
+
}
|
|
269
|
+
}()
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
var offerIdentifier: String? {
|
|
274
|
+
@inline(__always)
|
|
275
|
+
get {
|
|
276
|
+
return { () -> String? in
|
|
277
|
+
if bridge.has_value_std__optional_std__string_(self.__offerIdentifier) {
|
|
278
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__offerIdentifier)
|
|
279
|
+
return String(__unwrapped)
|
|
280
|
+
} else {
|
|
281
|
+
return nil
|
|
282
|
+
}
|
|
283
|
+
}()
|
|
284
|
+
}
|
|
285
|
+
@inline(__always)
|
|
286
|
+
set {
|
|
287
|
+
self.__offerIdentifier = { () -> bridge.std__optional_std__string_ in
|
|
288
|
+
if let __unwrappedValue = newValue {
|
|
289
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
290
|
+
} else {
|
|
291
|
+
return .init()
|
|
292
|
+
}
|
|
293
|
+
}()
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|