react-native-iap 14.4.9 → 14.4.11
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 +0 -8
- package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +59 -8
- package/ios/RnIapHelper.swift +32 -1
- package/lib/module/utils/type-bridge.js +39 -1
- package/lib/module/utils/type-bridge.js.map +1 -1
- package/lib/typescript/src/specs/RnIap.nitro.d.ts +29 -0
- package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
- package/lib/typescript/src/utils/type-bridge.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JFunc_void_NitroProduct.hpp +2 -0
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +4 -0
- package/nitrogen/generated/android/c++/JNitroOneTimePurchaseOfferDetail.hpp +61 -0
- package/nitrogen/generated/android/c++/JNitroProduct.hpp +16 -2
- package/nitrogen/generated/android/c++/JNitroPurchase.hpp +74 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroOneTimePurchaseOfferDetail.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroProduct.kt +10 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchase.kt +55 -1
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +18 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +3 -0
- package/nitrogen/generated/ios/swift/NitroOneTimePurchaseOfferDetail.swift +57 -0
- package/nitrogen/generated/ios/swift/NitroProduct.swift +91 -1
- package/nitrogen/generated/ios/swift/NitroPurchase.swift +520 -1
- package/nitrogen/generated/shared/c++/NitroOneTimePurchaseOfferDetail.hpp +75 -0
- package/nitrogen/generated/shared/c++/NitroProduct.hpp +17 -2
- package/nitrogen/generated/shared/c++/NitroPurchase.hpp +74 -2
- package/openiap-versions.json +1 -1
- package/package.json +4 -4
- package/src/specs/RnIap.nitro.ts +32 -0
- package/src/utils/type-bridge.ts +76 -16
- package/android/src/main/java/com/margelo/nitro/iap/Types.kt +0 -173
|
@@ -18,7 +18,7 @@ public extension NitroPurchase {
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `NitroPurchase`.
|
|
20
20
|
*/
|
|
21
|
-
init(id: String, productId: String, transactionDate: Double, purchaseToken: String?, platform: IapPlatform, quantity: Double, purchaseState: PurchaseState, isAutoRenewing: Bool, quantityIOS: Double?, originalTransactionDateIOS: Double?, originalTransactionIdentifierIOS: String?, appAccountToken: String?, purchaseTokenAndroid: String?, dataAndroid: String?, signatureAndroid: String?, autoRenewingAndroid: Bool?, purchaseStateAndroid: Double?, isAcknowledgedAndroid: Bool?, packageNameAndroid: String?, obfuscatedAccountIdAndroid: String?, obfuscatedProfileIdAndroid: String?) {
|
|
21
|
+
init(id: String, productId: String, transactionDate: Double, purchaseToken: String?, platform: IapPlatform, quantity: Double, purchaseState: PurchaseState, isAutoRenewing: Bool, quantityIOS: Double?, originalTransactionDateIOS: Double?, originalTransactionIdentifierIOS: String?, appAccountToken: String?, appBundleIdIOS: String?, countryCodeIOS: String?, currencyCodeIOS: String?, currencySymbolIOS: String?, environmentIOS: String?, expirationDateIOS: Double?, isUpgradedIOS: Bool?, offerIOS: String?, ownershipTypeIOS: String?, reasonIOS: String?, reasonStringRepresentationIOS: String?, revocationDateIOS: Double?, revocationReasonIOS: String?, storefrontCountryCodeIOS: String?, subscriptionGroupIdIOS: String?, transactionReasonIOS: String?, webOrderLineItemIdIOS: String?, purchaseTokenAndroid: String?, dataAndroid: String?, signatureAndroid: String?, autoRenewingAndroid: Bool?, purchaseStateAndroid: Double?, isAcknowledgedAndroid: Bool?, packageNameAndroid: String?, obfuscatedAccountIdAndroid: String?, obfuscatedProfileIdAndroid: String?, developerPayloadAndroid: String?) {
|
|
22
22
|
self.init(std.string(id), std.string(productId), transactionDate, { () -> bridge.std__optional_std__string_ in
|
|
23
23
|
if let __unwrappedValue = purchaseToken {
|
|
24
24
|
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
@@ -49,6 +49,108 @@ public extension NitroPurchase {
|
|
|
49
49
|
} else {
|
|
50
50
|
return .init()
|
|
51
51
|
}
|
|
52
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
53
|
+
if let __unwrappedValue = appBundleIdIOS {
|
|
54
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
55
|
+
} else {
|
|
56
|
+
return .init()
|
|
57
|
+
}
|
|
58
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
59
|
+
if let __unwrappedValue = countryCodeIOS {
|
|
60
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
61
|
+
} else {
|
|
62
|
+
return .init()
|
|
63
|
+
}
|
|
64
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
65
|
+
if let __unwrappedValue = currencyCodeIOS {
|
|
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 = currencySymbolIOS {
|
|
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 = environmentIOS {
|
|
78
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
79
|
+
} else {
|
|
80
|
+
return .init()
|
|
81
|
+
}
|
|
82
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
83
|
+
if let __unwrappedValue = expirationDateIOS {
|
|
84
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
85
|
+
} else {
|
|
86
|
+
return .init()
|
|
87
|
+
}
|
|
88
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
89
|
+
if let __unwrappedValue = isUpgradedIOS {
|
|
90
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
91
|
+
} else {
|
|
92
|
+
return .init()
|
|
93
|
+
}
|
|
94
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
95
|
+
if let __unwrappedValue = offerIOS {
|
|
96
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
97
|
+
} else {
|
|
98
|
+
return .init()
|
|
99
|
+
}
|
|
100
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
101
|
+
if let __unwrappedValue = ownershipTypeIOS {
|
|
102
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
103
|
+
} else {
|
|
104
|
+
return .init()
|
|
105
|
+
}
|
|
106
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
107
|
+
if let __unwrappedValue = reasonIOS {
|
|
108
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
109
|
+
} else {
|
|
110
|
+
return .init()
|
|
111
|
+
}
|
|
112
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
113
|
+
if let __unwrappedValue = reasonStringRepresentationIOS {
|
|
114
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
115
|
+
} else {
|
|
116
|
+
return .init()
|
|
117
|
+
}
|
|
118
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
119
|
+
if let __unwrappedValue = revocationDateIOS {
|
|
120
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
121
|
+
} else {
|
|
122
|
+
return .init()
|
|
123
|
+
}
|
|
124
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
125
|
+
if let __unwrappedValue = revocationReasonIOS {
|
|
126
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
127
|
+
} else {
|
|
128
|
+
return .init()
|
|
129
|
+
}
|
|
130
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
131
|
+
if let __unwrappedValue = storefrontCountryCodeIOS {
|
|
132
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
133
|
+
} else {
|
|
134
|
+
return .init()
|
|
135
|
+
}
|
|
136
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
137
|
+
if let __unwrappedValue = subscriptionGroupIdIOS {
|
|
138
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
139
|
+
} else {
|
|
140
|
+
return .init()
|
|
141
|
+
}
|
|
142
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
143
|
+
if let __unwrappedValue = transactionReasonIOS {
|
|
144
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
145
|
+
} else {
|
|
146
|
+
return .init()
|
|
147
|
+
}
|
|
148
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
149
|
+
if let __unwrappedValue = webOrderLineItemIdIOS {
|
|
150
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
151
|
+
} else {
|
|
152
|
+
return .init()
|
|
153
|
+
}
|
|
52
154
|
}(), { () -> bridge.std__optional_std__string_ in
|
|
53
155
|
if let __unwrappedValue = purchaseTokenAndroid {
|
|
54
156
|
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
@@ -103,6 +205,12 @@ public extension NitroPurchase {
|
|
|
103
205
|
} else {
|
|
104
206
|
return .init()
|
|
105
207
|
}
|
|
208
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
209
|
+
if let __unwrappedValue = developerPayloadAndroid {
|
|
210
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
211
|
+
} else {
|
|
212
|
+
return .init()
|
|
213
|
+
}
|
|
106
214
|
}())
|
|
107
215
|
}
|
|
108
216
|
|
|
@@ -289,6 +397,393 @@ public extension NitroPurchase {
|
|
|
289
397
|
}
|
|
290
398
|
}
|
|
291
399
|
|
|
400
|
+
var appBundleIdIOS: String? {
|
|
401
|
+
@inline(__always)
|
|
402
|
+
get {
|
|
403
|
+
return { () -> String? in
|
|
404
|
+
if bridge.has_value_std__optional_std__string_(self.__appBundleIdIOS) {
|
|
405
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__appBundleIdIOS)
|
|
406
|
+
return String(__unwrapped)
|
|
407
|
+
} else {
|
|
408
|
+
return nil
|
|
409
|
+
}
|
|
410
|
+
}()
|
|
411
|
+
}
|
|
412
|
+
@inline(__always)
|
|
413
|
+
set {
|
|
414
|
+
self.__appBundleIdIOS = { () -> bridge.std__optional_std__string_ in
|
|
415
|
+
if let __unwrappedValue = newValue {
|
|
416
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
417
|
+
} else {
|
|
418
|
+
return .init()
|
|
419
|
+
}
|
|
420
|
+
}()
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
var countryCodeIOS: String? {
|
|
425
|
+
@inline(__always)
|
|
426
|
+
get {
|
|
427
|
+
return { () -> String? in
|
|
428
|
+
if bridge.has_value_std__optional_std__string_(self.__countryCodeIOS) {
|
|
429
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__countryCodeIOS)
|
|
430
|
+
return String(__unwrapped)
|
|
431
|
+
} else {
|
|
432
|
+
return nil
|
|
433
|
+
}
|
|
434
|
+
}()
|
|
435
|
+
}
|
|
436
|
+
@inline(__always)
|
|
437
|
+
set {
|
|
438
|
+
self.__countryCodeIOS = { () -> bridge.std__optional_std__string_ in
|
|
439
|
+
if let __unwrappedValue = newValue {
|
|
440
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
441
|
+
} else {
|
|
442
|
+
return .init()
|
|
443
|
+
}
|
|
444
|
+
}()
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
var currencyCodeIOS: String? {
|
|
449
|
+
@inline(__always)
|
|
450
|
+
get {
|
|
451
|
+
return { () -> String? in
|
|
452
|
+
if bridge.has_value_std__optional_std__string_(self.__currencyCodeIOS) {
|
|
453
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__currencyCodeIOS)
|
|
454
|
+
return String(__unwrapped)
|
|
455
|
+
} else {
|
|
456
|
+
return nil
|
|
457
|
+
}
|
|
458
|
+
}()
|
|
459
|
+
}
|
|
460
|
+
@inline(__always)
|
|
461
|
+
set {
|
|
462
|
+
self.__currencyCodeIOS = { () -> bridge.std__optional_std__string_ in
|
|
463
|
+
if let __unwrappedValue = newValue {
|
|
464
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
465
|
+
} else {
|
|
466
|
+
return .init()
|
|
467
|
+
}
|
|
468
|
+
}()
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
var currencySymbolIOS: String? {
|
|
473
|
+
@inline(__always)
|
|
474
|
+
get {
|
|
475
|
+
return { () -> String? in
|
|
476
|
+
if bridge.has_value_std__optional_std__string_(self.__currencySymbolIOS) {
|
|
477
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__currencySymbolIOS)
|
|
478
|
+
return String(__unwrapped)
|
|
479
|
+
} else {
|
|
480
|
+
return nil
|
|
481
|
+
}
|
|
482
|
+
}()
|
|
483
|
+
}
|
|
484
|
+
@inline(__always)
|
|
485
|
+
set {
|
|
486
|
+
self.__currencySymbolIOS = { () -> bridge.std__optional_std__string_ in
|
|
487
|
+
if let __unwrappedValue = newValue {
|
|
488
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
489
|
+
} else {
|
|
490
|
+
return .init()
|
|
491
|
+
}
|
|
492
|
+
}()
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
var environmentIOS: String? {
|
|
497
|
+
@inline(__always)
|
|
498
|
+
get {
|
|
499
|
+
return { () -> String? in
|
|
500
|
+
if bridge.has_value_std__optional_std__string_(self.__environmentIOS) {
|
|
501
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__environmentIOS)
|
|
502
|
+
return String(__unwrapped)
|
|
503
|
+
} else {
|
|
504
|
+
return nil
|
|
505
|
+
}
|
|
506
|
+
}()
|
|
507
|
+
}
|
|
508
|
+
@inline(__always)
|
|
509
|
+
set {
|
|
510
|
+
self.__environmentIOS = { () -> bridge.std__optional_std__string_ in
|
|
511
|
+
if let __unwrappedValue = newValue {
|
|
512
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
513
|
+
} else {
|
|
514
|
+
return .init()
|
|
515
|
+
}
|
|
516
|
+
}()
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
var expirationDateIOS: Double? {
|
|
521
|
+
@inline(__always)
|
|
522
|
+
get {
|
|
523
|
+
return self.__expirationDateIOS.value
|
|
524
|
+
}
|
|
525
|
+
@inline(__always)
|
|
526
|
+
set {
|
|
527
|
+
self.__expirationDateIOS = { () -> bridge.std__optional_double_ in
|
|
528
|
+
if let __unwrappedValue = newValue {
|
|
529
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
530
|
+
} else {
|
|
531
|
+
return .init()
|
|
532
|
+
}
|
|
533
|
+
}()
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
var isUpgradedIOS: Bool? {
|
|
538
|
+
@inline(__always)
|
|
539
|
+
get {
|
|
540
|
+
return self.__isUpgradedIOS.value
|
|
541
|
+
}
|
|
542
|
+
@inline(__always)
|
|
543
|
+
set {
|
|
544
|
+
self.__isUpgradedIOS = { () -> bridge.std__optional_bool_ in
|
|
545
|
+
if let __unwrappedValue = newValue {
|
|
546
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
547
|
+
} else {
|
|
548
|
+
return .init()
|
|
549
|
+
}
|
|
550
|
+
}()
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
var offerIOS: String? {
|
|
555
|
+
@inline(__always)
|
|
556
|
+
get {
|
|
557
|
+
return { () -> String? in
|
|
558
|
+
if bridge.has_value_std__optional_std__string_(self.__offerIOS) {
|
|
559
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__offerIOS)
|
|
560
|
+
return String(__unwrapped)
|
|
561
|
+
} else {
|
|
562
|
+
return nil
|
|
563
|
+
}
|
|
564
|
+
}()
|
|
565
|
+
}
|
|
566
|
+
@inline(__always)
|
|
567
|
+
set {
|
|
568
|
+
self.__offerIOS = { () -> bridge.std__optional_std__string_ in
|
|
569
|
+
if let __unwrappedValue = newValue {
|
|
570
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
571
|
+
} else {
|
|
572
|
+
return .init()
|
|
573
|
+
}
|
|
574
|
+
}()
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
var ownershipTypeIOS: String? {
|
|
579
|
+
@inline(__always)
|
|
580
|
+
get {
|
|
581
|
+
return { () -> String? in
|
|
582
|
+
if bridge.has_value_std__optional_std__string_(self.__ownershipTypeIOS) {
|
|
583
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__ownershipTypeIOS)
|
|
584
|
+
return String(__unwrapped)
|
|
585
|
+
} else {
|
|
586
|
+
return nil
|
|
587
|
+
}
|
|
588
|
+
}()
|
|
589
|
+
}
|
|
590
|
+
@inline(__always)
|
|
591
|
+
set {
|
|
592
|
+
self.__ownershipTypeIOS = { () -> bridge.std__optional_std__string_ in
|
|
593
|
+
if let __unwrappedValue = newValue {
|
|
594
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
595
|
+
} else {
|
|
596
|
+
return .init()
|
|
597
|
+
}
|
|
598
|
+
}()
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
var reasonIOS: String? {
|
|
603
|
+
@inline(__always)
|
|
604
|
+
get {
|
|
605
|
+
return { () -> String? in
|
|
606
|
+
if bridge.has_value_std__optional_std__string_(self.__reasonIOS) {
|
|
607
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__reasonIOS)
|
|
608
|
+
return String(__unwrapped)
|
|
609
|
+
} else {
|
|
610
|
+
return nil
|
|
611
|
+
}
|
|
612
|
+
}()
|
|
613
|
+
}
|
|
614
|
+
@inline(__always)
|
|
615
|
+
set {
|
|
616
|
+
self.__reasonIOS = { () -> bridge.std__optional_std__string_ in
|
|
617
|
+
if let __unwrappedValue = newValue {
|
|
618
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
619
|
+
} else {
|
|
620
|
+
return .init()
|
|
621
|
+
}
|
|
622
|
+
}()
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
var reasonStringRepresentationIOS: String? {
|
|
627
|
+
@inline(__always)
|
|
628
|
+
get {
|
|
629
|
+
return { () -> String? in
|
|
630
|
+
if bridge.has_value_std__optional_std__string_(self.__reasonStringRepresentationIOS) {
|
|
631
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__reasonStringRepresentationIOS)
|
|
632
|
+
return String(__unwrapped)
|
|
633
|
+
} else {
|
|
634
|
+
return nil
|
|
635
|
+
}
|
|
636
|
+
}()
|
|
637
|
+
}
|
|
638
|
+
@inline(__always)
|
|
639
|
+
set {
|
|
640
|
+
self.__reasonStringRepresentationIOS = { () -> bridge.std__optional_std__string_ in
|
|
641
|
+
if let __unwrappedValue = newValue {
|
|
642
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
643
|
+
} else {
|
|
644
|
+
return .init()
|
|
645
|
+
}
|
|
646
|
+
}()
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
var revocationDateIOS: Double? {
|
|
651
|
+
@inline(__always)
|
|
652
|
+
get {
|
|
653
|
+
return self.__revocationDateIOS.value
|
|
654
|
+
}
|
|
655
|
+
@inline(__always)
|
|
656
|
+
set {
|
|
657
|
+
self.__revocationDateIOS = { () -> bridge.std__optional_double_ in
|
|
658
|
+
if let __unwrappedValue = newValue {
|
|
659
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
660
|
+
} else {
|
|
661
|
+
return .init()
|
|
662
|
+
}
|
|
663
|
+
}()
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
var revocationReasonIOS: String? {
|
|
668
|
+
@inline(__always)
|
|
669
|
+
get {
|
|
670
|
+
return { () -> String? in
|
|
671
|
+
if bridge.has_value_std__optional_std__string_(self.__revocationReasonIOS) {
|
|
672
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__revocationReasonIOS)
|
|
673
|
+
return String(__unwrapped)
|
|
674
|
+
} else {
|
|
675
|
+
return nil
|
|
676
|
+
}
|
|
677
|
+
}()
|
|
678
|
+
}
|
|
679
|
+
@inline(__always)
|
|
680
|
+
set {
|
|
681
|
+
self.__revocationReasonIOS = { () -> bridge.std__optional_std__string_ in
|
|
682
|
+
if let __unwrappedValue = newValue {
|
|
683
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
684
|
+
} else {
|
|
685
|
+
return .init()
|
|
686
|
+
}
|
|
687
|
+
}()
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
var storefrontCountryCodeIOS: String? {
|
|
692
|
+
@inline(__always)
|
|
693
|
+
get {
|
|
694
|
+
return { () -> String? in
|
|
695
|
+
if bridge.has_value_std__optional_std__string_(self.__storefrontCountryCodeIOS) {
|
|
696
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__storefrontCountryCodeIOS)
|
|
697
|
+
return String(__unwrapped)
|
|
698
|
+
} else {
|
|
699
|
+
return nil
|
|
700
|
+
}
|
|
701
|
+
}()
|
|
702
|
+
}
|
|
703
|
+
@inline(__always)
|
|
704
|
+
set {
|
|
705
|
+
self.__storefrontCountryCodeIOS = { () -> bridge.std__optional_std__string_ in
|
|
706
|
+
if let __unwrappedValue = newValue {
|
|
707
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
708
|
+
} else {
|
|
709
|
+
return .init()
|
|
710
|
+
}
|
|
711
|
+
}()
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
var subscriptionGroupIdIOS: String? {
|
|
716
|
+
@inline(__always)
|
|
717
|
+
get {
|
|
718
|
+
return { () -> String? in
|
|
719
|
+
if bridge.has_value_std__optional_std__string_(self.__subscriptionGroupIdIOS) {
|
|
720
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__subscriptionGroupIdIOS)
|
|
721
|
+
return String(__unwrapped)
|
|
722
|
+
} else {
|
|
723
|
+
return nil
|
|
724
|
+
}
|
|
725
|
+
}()
|
|
726
|
+
}
|
|
727
|
+
@inline(__always)
|
|
728
|
+
set {
|
|
729
|
+
self.__subscriptionGroupIdIOS = { () -> bridge.std__optional_std__string_ in
|
|
730
|
+
if let __unwrappedValue = newValue {
|
|
731
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
732
|
+
} else {
|
|
733
|
+
return .init()
|
|
734
|
+
}
|
|
735
|
+
}()
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
var transactionReasonIOS: String? {
|
|
740
|
+
@inline(__always)
|
|
741
|
+
get {
|
|
742
|
+
return { () -> String? in
|
|
743
|
+
if bridge.has_value_std__optional_std__string_(self.__transactionReasonIOS) {
|
|
744
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__transactionReasonIOS)
|
|
745
|
+
return String(__unwrapped)
|
|
746
|
+
} else {
|
|
747
|
+
return nil
|
|
748
|
+
}
|
|
749
|
+
}()
|
|
750
|
+
}
|
|
751
|
+
@inline(__always)
|
|
752
|
+
set {
|
|
753
|
+
self.__transactionReasonIOS = { () -> bridge.std__optional_std__string_ in
|
|
754
|
+
if let __unwrappedValue = newValue {
|
|
755
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
756
|
+
} else {
|
|
757
|
+
return .init()
|
|
758
|
+
}
|
|
759
|
+
}()
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
var webOrderLineItemIdIOS: String? {
|
|
764
|
+
@inline(__always)
|
|
765
|
+
get {
|
|
766
|
+
return { () -> String? in
|
|
767
|
+
if bridge.has_value_std__optional_std__string_(self.__webOrderLineItemIdIOS) {
|
|
768
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__webOrderLineItemIdIOS)
|
|
769
|
+
return String(__unwrapped)
|
|
770
|
+
} else {
|
|
771
|
+
return nil
|
|
772
|
+
}
|
|
773
|
+
}()
|
|
774
|
+
}
|
|
775
|
+
@inline(__always)
|
|
776
|
+
set {
|
|
777
|
+
self.__webOrderLineItemIdIOS = { () -> bridge.std__optional_std__string_ in
|
|
778
|
+
if let __unwrappedValue = newValue {
|
|
779
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
780
|
+
} else {
|
|
781
|
+
return .init()
|
|
782
|
+
}
|
|
783
|
+
}()
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
|
|
292
787
|
var purchaseTokenAndroid: String? {
|
|
293
788
|
@inline(__always)
|
|
294
789
|
get {
|
|
@@ -483,4 +978,28 @@ public extension NitroPurchase {
|
|
|
483
978
|
}()
|
|
484
979
|
}
|
|
485
980
|
}
|
|
981
|
+
|
|
982
|
+
var developerPayloadAndroid: String? {
|
|
983
|
+
@inline(__always)
|
|
984
|
+
get {
|
|
985
|
+
return { () -> String? in
|
|
986
|
+
if bridge.has_value_std__optional_std__string_(self.__developerPayloadAndroid) {
|
|
987
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__developerPayloadAndroid)
|
|
988
|
+
return String(__unwrapped)
|
|
989
|
+
} else {
|
|
990
|
+
return nil
|
|
991
|
+
}
|
|
992
|
+
}()
|
|
993
|
+
}
|
|
994
|
+
@inline(__always)
|
|
995
|
+
set {
|
|
996
|
+
self.__developerPayloadAndroid = { () -> bridge.std__optional_std__string_ in
|
|
997
|
+
if let __unwrappedValue = newValue {
|
|
998
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
999
|
+
} else {
|
|
1000
|
+
return .init()
|
|
1001
|
+
}
|
|
1002
|
+
}()
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
486
1005
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroOneTimePurchaseOfferDetail.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
#include <string>
|
|
24
|
+
|
|
25
|
+
namespace margelo::nitro::iap {
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A struct which can be represented as a JavaScript object (NitroOneTimePurchaseOfferDetail).
|
|
29
|
+
*/
|
|
30
|
+
struct NitroOneTimePurchaseOfferDetail {
|
|
31
|
+
public:
|
|
32
|
+
std::string formattedPrice SWIFT_PRIVATE;
|
|
33
|
+
std::string priceAmountMicros SWIFT_PRIVATE;
|
|
34
|
+
std::string priceCurrencyCode SWIFT_PRIVATE;
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
NitroOneTimePurchaseOfferDetail() = default;
|
|
38
|
+
explicit NitroOneTimePurchaseOfferDetail(std::string formattedPrice, std::string priceAmountMicros, std::string priceCurrencyCode): formattedPrice(formattedPrice), priceAmountMicros(priceAmountMicros), priceCurrencyCode(priceCurrencyCode) {}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
} // namespace margelo::nitro::iap
|
|
42
|
+
|
|
43
|
+
namespace margelo::nitro {
|
|
44
|
+
|
|
45
|
+
// C++ NitroOneTimePurchaseOfferDetail <> JS NitroOneTimePurchaseOfferDetail (object)
|
|
46
|
+
template <>
|
|
47
|
+
struct JSIConverter<margelo::nitro::iap::NitroOneTimePurchaseOfferDetail> final {
|
|
48
|
+
static inline margelo::nitro::iap::NitroOneTimePurchaseOfferDetail fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
49
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
50
|
+
return margelo::nitro::iap::NitroOneTimePurchaseOfferDetail(
|
|
51
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "formattedPrice")),
|
|
52
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "priceAmountMicros")),
|
|
53
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "priceCurrencyCode"))
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroOneTimePurchaseOfferDetail& arg) {
|
|
57
|
+
jsi::Object obj(runtime);
|
|
58
|
+
obj.setProperty(runtime, "formattedPrice", JSIConverter<std::string>::toJSI(runtime, arg.formattedPrice));
|
|
59
|
+
obj.setProperty(runtime, "priceAmountMicros", JSIConverter<std::string>::toJSI(runtime, arg.priceAmountMicros));
|
|
60
|
+
obj.setProperty(runtime, "priceCurrencyCode", JSIConverter<std::string>::toJSI(runtime, arg.priceCurrencyCode));
|
|
61
|
+
return obj;
|
|
62
|
+
}
|
|
63
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
64
|
+
if (!value.isObject()) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
jsi::Object obj = value.getObject(runtime);
|
|
68
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "formattedPrice"))) return false;
|
|
69
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "priceAmountMicros"))) return false;
|
|
70
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "priceCurrencyCode"))) return false;
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
} // namespace margelo::nitro
|