react-native-iap 14.3.4 → 14.3.5

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.
Files changed (76) hide show
  1. package/NitroIap.podspec +1 -1
  2. package/README.md +1 -1
  3. package/android/CMakeLists.txt +4 -0
  4. package/android/build.gradle +2 -2
  5. package/android/src/main/cpp/cpp-adapter.cpp +8 -0
  6. package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +93 -51
  7. package/ios/HybridRnIap.swift +38 -30
  8. package/lib/module/hooks/useIAP.js +4 -4
  9. package/lib/module/hooks/useIAP.js.map +1 -1
  10. package/lib/module/index.js +54 -53
  11. package/lib/module/index.js.map +1 -1
  12. package/lib/module/types.js +1 -59
  13. package/lib/module/types.js.map +1 -1
  14. package/lib/module/utils/type-bridge.js +44 -33
  15. package/lib/module/utils/type-bridge.js.map +1 -1
  16. package/lib/typescript/src/hooks/useIAP.d.ts +4 -4
  17. package/lib/typescript/src/hooks/useIAP.d.ts.map +1 -1
  18. package/lib/typescript/src/index.d.ts +8 -7
  19. package/lib/typescript/src/index.d.ts.map +1 -1
  20. package/lib/typescript/src/specs/RnIap.nitro.d.ts +2 -1
  21. package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
  22. package/lib/typescript/src/types.d.ts +159 -204
  23. package/lib/typescript/src/types.d.ts.map +1 -1
  24. package/lib/typescript/src/utils/type-bridge.d.ts.map +1 -1
  25. package/nitrogen/generated/android/NitroIap+autolinking.cmake +9 -4
  26. package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +32 -5
  27. package/nitrogen/generated/android/c++/JHybridRnIapSpec.hpp +1 -1
  28. package/nitrogen/generated/android/c++/JIapPlatform.hpp +59 -0
  29. package/nitrogen/generated/android/c++/JPurchase.cpp +26 -0
  30. package/nitrogen/generated/android/c++/JPurchase.hpp +80 -0
  31. package/nitrogen/generated/android/c++/JPurchaseAndroid.hpp +140 -0
  32. package/nitrogen/generated/android/c++/JPurchaseIOS.hpp +194 -0
  33. package/nitrogen/generated/android/c++/JPurchaseOfferIOS.hpp +61 -0
  34. package/nitrogen/generated/android/c++/JPurchaseState.hpp +71 -0
  35. package/nitrogen/generated/android/c++/JRequestPurchaseResult.hpp +89 -0
  36. package/nitrogen/generated/android/c++/JVariant_PurchaseAndroid_PurchaseIOS.cpp +26 -0
  37. package/nitrogen/generated/android/c++/JVariant_PurchaseAndroid_PurchaseIOS.hpp +80 -0
  38. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +1 -1
  39. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/IapPlatform.kt +21 -0
  40. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Purchase.kt +42 -0
  41. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseAndroid.kt +77 -0
  42. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseIOS.kt +116 -0
  43. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseOfferIOS.kt +35 -0
  44. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseState.kt +25 -0
  45. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/RequestPurchaseResult.kt +32 -0
  46. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_PurchaseAndroid_PurchaseIOS.kt +42 -0
  47. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.cpp +13 -5
  48. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +186 -25
  49. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +18 -0
  50. package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +20 -2
  51. package/nitrogen/generated/ios/swift/Func_void_RequestPurchaseResult.swift +47 -0
  52. package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +1 -1
  53. package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +7 -7
  54. package/nitrogen/generated/ios/swift/IapPlatform.swift +40 -0
  55. package/nitrogen/generated/ios/swift/Purchase.swift +18 -0
  56. package/nitrogen/generated/ios/swift/PurchaseAndroid.swift +399 -0
  57. package/nitrogen/generated/ios/swift/PurchaseIOS.swift +768 -0
  58. package/nitrogen/generated/ios/swift/PurchaseOfferIOS.swift +57 -0
  59. package/nitrogen/generated/ios/swift/PurchaseState.swift +56 -0
  60. package/nitrogen/generated/ios/swift/RequestPurchaseResult.swift +148 -0
  61. package/nitrogen/generated/ios/swift/Variant_PurchaseAndroid_PurchaseIOS.swift +18 -0
  62. package/nitrogen/generated/shared/c++/HybridRnIapSpec.hpp +4 -1
  63. package/nitrogen/generated/shared/c++/IapPlatform.hpp +76 -0
  64. package/nitrogen/generated/shared/c++/PurchaseAndroid.hpp +138 -0
  65. package/nitrogen/generated/shared/c++/PurchaseIOS.hpp +193 -0
  66. package/nitrogen/generated/shared/c++/PurchaseOfferIOS.hpp +75 -0
  67. package/nitrogen/generated/shared/c++/PurchaseState.hpp +92 -0
  68. package/nitrogen/generated/shared/c++/RequestPurchaseResult.hpp +78 -0
  69. package/package.json +5 -4
  70. package/plugin/build/withIAP.js +1 -1
  71. package/plugin/src/withIAP.ts +1 -1
  72. package/src/hooks/useIAP.ts +14 -8
  73. package/src/index.ts +73 -74
  74. package/src/specs/RnIap.nitro.ts +4 -1
  75. package/src/types.ts +183 -216
  76. package/src/utils/type-bridge.ts +55 -43
@@ -10,6 +10,8 @@
10
10
  // Forward declarations of C++ defined types
11
11
  // Forward declaration of `HybridRnIapSpec` to properly resolve imports.
12
12
  namespace margelo::nitro::iap { class HybridRnIapSpec; }
13
+ // Forward declaration of `IapPlatform` to properly resolve imports.
14
+ namespace margelo::nitro::iap { enum class IapPlatform; }
13
15
  // Forward declaration of `NitroAvailablePurchasesAndroidOptions` to properly resolve imports.
14
16
  namespace margelo::nitro::iap { struct NitroAvailablePurchasesAndroidOptions; }
15
17
  // Forward declaration of `NitroAvailablePurchasesIosOptions` to properly resolve imports.
@@ -50,9 +52,20 @@ namespace margelo::nitro::iap { struct NitroSubscriptionOffer; }
50
52
  namespace margelo::nitro::iap { struct NitroSubscriptionRenewalInfo; }
51
53
  // Forward declaration of `NitroSubscriptionStatus` to properly resolve imports.
52
54
  namespace margelo::nitro::iap { struct NitroSubscriptionStatus; }
55
+ // Forward declaration of `PurchaseAndroid` to properly resolve imports.
56
+ namespace margelo::nitro::iap { struct PurchaseAndroid; }
57
+ // Forward declaration of `PurchaseIOS` to properly resolve imports.
58
+ namespace margelo::nitro::iap { struct PurchaseIOS; }
59
+ // Forward declaration of `PurchaseOfferIOS` to properly resolve imports.
60
+ namespace margelo::nitro::iap { struct PurchaseOfferIOS; }
61
+ // Forward declaration of `PurchaseState` to properly resolve imports.
62
+ namespace margelo::nitro::iap { enum class PurchaseState; }
63
+ // Forward declaration of `RequestPurchaseResult` to properly resolve imports.
64
+ namespace margelo::nitro::iap { struct RequestPurchaseResult; }
53
65
 
54
66
  // Include C++ defined types
55
67
  #include "HybridRnIapSpec.hpp"
68
+ #include "IapPlatform.hpp"
56
69
  #include "NitroAvailablePurchasesAndroidOptions.hpp"
57
70
  #include "NitroAvailablePurchasesIosOptions.hpp"
58
71
  #include "NitroAvailablePurchasesOptions.hpp"
@@ -73,6 +86,11 @@ namespace margelo::nitro::iap { struct NitroSubscriptionStatus; }
73
86
  #include "NitroSubscriptionOffer.hpp"
74
87
  #include "NitroSubscriptionRenewalInfo.hpp"
75
88
  #include "NitroSubscriptionStatus.hpp"
89
+ #include "PurchaseAndroid.hpp"
90
+ #include "PurchaseIOS.hpp"
91
+ #include "PurchaseOfferIOS.hpp"
92
+ #include "PurchaseState.hpp"
93
+ #include "RequestPurchaseResult.hpp"
76
94
  #include <NitroModules/Promise.hpp>
77
95
  #include <NitroModules/Result.hpp>
78
96
  #include <exception>
@@ -14,6 +14,18 @@ namespace NitroIap { class HybridRnIapSpec_cxx; }
14
14
 
15
15
  // Forward declaration of `NitroProduct` to properly resolve imports.
16
16
  namespace margelo::nitro::iap { struct NitroProduct; }
17
+ // Forward declaration of `RequestPurchaseResult` to properly resolve imports.
18
+ namespace margelo::nitro::iap { struct RequestPurchaseResult; }
19
+ // Forward declaration of `PurchaseAndroid` to properly resolve imports.
20
+ namespace margelo::nitro::iap { struct PurchaseAndroid; }
21
+ // Forward declaration of `PurchaseIOS` to properly resolve imports.
22
+ namespace margelo::nitro::iap { struct PurchaseIOS; }
23
+ // Forward declaration of `IapPlatform` to properly resolve imports.
24
+ namespace margelo::nitro::iap { enum class IapPlatform; }
25
+ // Forward declaration of `PurchaseState` to properly resolve imports.
26
+ namespace margelo::nitro::iap { enum class PurchaseState; }
27
+ // Forward declaration of `PurchaseOfferIOS` to properly resolve imports.
28
+ namespace margelo::nitro::iap { struct PurchaseOfferIOS; }
17
29
  // Forward declaration of `NitroPurchaseRequest` to properly resolve imports.
18
30
  namespace margelo::nitro::iap { struct NitroPurchaseRequest; }
19
31
  // Forward declaration of `NitroRequestPurchaseIos` to properly resolve imports.
@@ -58,6 +70,13 @@ namespace margelo::nitro::iap { struct NitroDeepLinkOptionsAndroid; }
58
70
  #include <vector>
59
71
  #include <string>
60
72
  #include <optional>
73
+ #include "RequestPurchaseResult.hpp"
74
+ #include "PurchaseAndroid.hpp"
75
+ #include "PurchaseIOS.hpp"
76
+ #include <variant>
77
+ #include "IapPlatform.hpp"
78
+ #include "PurchaseState.hpp"
79
+ #include "PurchaseOfferIOS.hpp"
61
80
  #include "NitroPurchaseRequest.hpp"
62
81
  #include "NitroRequestPurchaseIos.hpp"
63
82
  #include <unordered_map>
@@ -68,7 +87,6 @@ namespace margelo::nitro::iap { struct NitroDeepLinkOptionsAndroid; }
68
87
  #include "NitroAvailablePurchasesIosOptions.hpp"
69
88
  #include "NitroAvailablePurchasesAndroidOptions.hpp"
70
89
  #include "NitroPurchaseResult.hpp"
71
- #include <variant>
72
90
  #include "NitroFinishTransactionParams.hpp"
73
91
  #include "NitroFinishTransactionIosParams.hpp"
74
92
  #include "NitroFinishTransactionAndroidParams.hpp"
@@ -146,7 +164,7 @@ namespace margelo::nitro::iap {
146
164
  auto __value = std::move(__result.value());
147
165
  return __value;
148
166
  }
149
- inline std::shared_ptr<Promise<void>> requestPurchase(const NitroPurchaseRequest& request) override {
167
+ inline std::shared_ptr<Promise<RequestPurchaseResult>> requestPurchase(const NitroPurchaseRequest& request) override {
150
168
  auto __result = _swiftPart.requestPurchase(request);
151
169
  if (__result.hasError()) [[unlikely]] {
152
170
  std::rethrow_exception(__result.error());
@@ -0,0 +1,47 @@
1
+ ///
2
+ /// Func_void_RequestPurchaseResult.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
+ /**
12
+ * Wraps a Swift `(_ value: RequestPurchaseResult) -> Void` as a class.
13
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
14
+ */
15
+ public final class Func_void_RequestPurchaseResult {
16
+ public typealias bridge = margelo.nitro.iap.bridge.swift
17
+
18
+ private let closure: (_ value: RequestPurchaseResult) -> Void
19
+
20
+ public init(_ closure: @escaping (_ value: RequestPurchaseResult) -> Void) {
21
+ self.closure = closure
22
+ }
23
+
24
+ @inline(__always)
25
+ public func call(value: RequestPurchaseResult) -> Void {
26
+ self.closure(value)
27
+ }
28
+
29
+ /**
30
+ * Casts this instance to a retained unsafe raw pointer.
31
+ * This acquires one additional strong reference on the object!
32
+ */
33
+ @inline(__always)
34
+ public func toUnsafe() -> UnsafeMutableRawPointer {
35
+ return Unmanaged.passRetained(self).toOpaque()
36
+ }
37
+
38
+ /**
39
+ * Casts an unsafe pointer to a `Func_void_RequestPurchaseResult`.
40
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_RequestPurchaseResult>`.
41
+ * This removes one strong reference from the object!
42
+ */
43
+ @inline(__always)
44
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_RequestPurchaseResult {
45
+ return Unmanaged<Func_void_RequestPurchaseResult>.fromOpaque(pointer).takeRetainedValue()
46
+ }
47
+ }
@@ -17,7 +17,7 @@ public protocol HybridRnIapSpec_protocol: HybridObject {
17
17
  func initConnection() throws -> Promise<Bool>
18
18
  func endConnection() throws -> Promise<Bool>
19
19
  func fetchProducts(skus: [String], type: String) throws -> Promise<[NitroProduct]>
20
- func requestPurchase(request: NitroPurchaseRequest) throws -> Promise<Void>
20
+ func requestPurchase(request: NitroPurchaseRequest) throws -> Promise<RequestPurchaseResult>
21
21
  func getAvailablePurchases(options: NitroAvailablePurchasesOptions?) throws -> Promise<[NitroPurchase]>
22
22
  func finishTransaction(params: NitroFinishTransactionParams) throws -> Promise<Variant_Bool_NitroPurchaseResult>
23
23
  func addPurchaseUpdatedListener(listener: @escaping (_ purchase: NitroPurchase) -> Void) throws -> Void
@@ -173,21 +173,21 @@ open class HybridRnIapSpec_cxx {
173
173
  }
174
174
 
175
175
  @inline(__always)
176
- public final func requestPurchase(request: NitroPurchaseRequest) -> bridge.Result_std__shared_ptr_Promise_void___ {
176
+ public final func requestPurchase(request: NitroPurchaseRequest) -> bridge.Result_std__shared_ptr_Promise_RequestPurchaseResult___ {
177
177
  do {
178
178
  let __result = try self.__implementation.requestPurchase(request: request)
179
- let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in
180
- let __promise = bridge.create_std__shared_ptr_Promise_void__()
181
- let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise)
179
+ let __resultCpp = { () -> bridge.std__shared_ptr_Promise_RequestPurchaseResult__ in
180
+ let __promise = bridge.create_std__shared_ptr_Promise_RequestPurchaseResult__()
181
+ let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_RequestPurchaseResult__(__promise)
182
182
  __result
183
- .then({ __result in __promiseHolder.resolve() })
183
+ .then({ __result in __promiseHolder.resolve(__result) })
184
184
  .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
185
185
  return __promise
186
186
  }()
187
- return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp)
187
+ return bridge.create_Result_std__shared_ptr_Promise_RequestPurchaseResult___(__resultCpp)
188
188
  } catch (let __error) {
189
189
  let __exceptionPtr = __error.toCpp()
190
- return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr)
190
+ return bridge.create_Result_std__shared_ptr_Promise_RequestPurchaseResult___(__exceptionPtr)
191
191
  }
192
192
  }
193
193
 
@@ -0,0 +1,40 @@
1
+ ///
2
+ /// IapPlatform.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
+ /**
9
+ * Represents the JS union `IapPlatform`, backed by a C++ enum.
10
+ */
11
+ public typealias IapPlatform = margelo.nitro.iap.IapPlatform
12
+
13
+ public extension IapPlatform {
14
+ /**
15
+ * Get a IapPlatform for the given String value, or
16
+ * return `nil` if the given value was invalid/unknown.
17
+ */
18
+ init?(fromString string: String) {
19
+ switch string {
20
+ case "android":
21
+ self = .android
22
+ case "ios":
23
+ self = .ios
24
+ default:
25
+ return nil
26
+ }
27
+ }
28
+
29
+ /**
30
+ * Get the String value this IapPlatform represents.
31
+ */
32
+ var stringValue: String {
33
+ switch self {
34
+ case .android:
35
+ return "android"
36
+ case .ios:
37
+ return "ios"
38
+ }
39
+ }
40
+ }
@@ -0,0 +1,18 @@
1
+ ///
2
+ /// Purchase.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
+
9
+
10
+ /**
11
+ * An Swift enum with associated values representing a Variant/Union type.
12
+ * JS type: `struct | struct`
13
+ */
14
+ @frozen
15
+ public indirect enum Purchase {
16
+ case first(PurchaseAndroid)
17
+ case second(PurchaseIOS)
18
+ }
@@ -0,0 +1,399 @@
1
+ ///
2
+ /// PurchaseAndroid.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 `PurchaseAndroid`, backed by a C++ struct.
12
+ */
13
+ public typealias PurchaseAndroid = margelo.nitro.iap.PurchaseAndroid
14
+
15
+ public extension PurchaseAndroid {
16
+ private typealias bridge = margelo.nitro.iap.bridge.swift
17
+
18
+ /**
19
+ * Create a new instance of `PurchaseAndroid`.
20
+ */
21
+ init(autoRenewingAndroid: Bool?, dataAndroid: String?, developerPayloadAndroid: String?, id: String, ids: [String]?, isAcknowledgedAndroid: Bool?, isAutoRenewing: Bool, obfuscatedAccountIdAndroid: String?, obfuscatedProfileIdAndroid: String?, packageNameAndroid: String?, platform: IapPlatform, productId: String, purchaseState: PurchaseState, purchaseToken: String?, quantity: Double, signatureAndroid: String?, transactionDate: Double) {
22
+ self.init({ () -> bridge.std__optional_bool_ in
23
+ if let __unwrappedValue = autoRenewingAndroid {
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 = dataAndroid {
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 = developerPayloadAndroid {
36
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
37
+ } else {
38
+ return .init()
39
+ }
40
+ }(), std.string(id), { () -> bridge.std__optional_std__vector_std__string__ in
41
+ if let __unwrappedValue = ids {
42
+ return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
43
+ var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
44
+ for __item in __unwrappedValue {
45
+ __vector.push_back(std.string(__item))
46
+ }
47
+ return __vector
48
+ }())
49
+ } else {
50
+ return .init()
51
+ }
52
+ }(), { () -> bridge.std__optional_bool_ in
53
+ if let __unwrappedValue = isAcknowledgedAndroid {
54
+ return bridge.create_std__optional_bool_(__unwrappedValue)
55
+ } else {
56
+ return .init()
57
+ }
58
+ }(), isAutoRenewing, { () -> bridge.std__optional_std__string_ in
59
+ if let __unwrappedValue = obfuscatedAccountIdAndroid {
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 = obfuscatedProfileIdAndroid {
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 = packageNameAndroid {
72
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
73
+ } else {
74
+ return .init()
75
+ }
76
+ }(), platform, std.string(productId), purchaseState, { () -> bridge.std__optional_std__string_ in
77
+ if let __unwrappedValue = purchaseToken {
78
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
79
+ } else {
80
+ return .init()
81
+ }
82
+ }(), quantity, { () -> bridge.std__optional_std__string_ in
83
+ if let __unwrappedValue = signatureAndroid {
84
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
85
+ } else {
86
+ return .init()
87
+ }
88
+ }(), transactionDate)
89
+ }
90
+
91
+ var autoRenewingAndroid: Bool? {
92
+ @inline(__always)
93
+ get {
94
+ return self.__autoRenewingAndroid.value
95
+ }
96
+ @inline(__always)
97
+ set {
98
+ self.__autoRenewingAndroid = { () -> bridge.std__optional_bool_ in
99
+ if let __unwrappedValue = newValue {
100
+ return bridge.create_std__optional_bool_(__unwrappedValue)
101
+ } else {
102
+ return .init()
103
+ }
104
+ }()
105
+ }
106
+ }
107
+
108
+ var dataAndroid: String? {
109
+ @inline(__always)
110
+ get {
111
+ return { () -> String? in
112
+ if bridge.has_value_std__optional_std__string_(self.__dataAndroid) {
113
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__dataAndroid)
114
+ return String(__unwrapped)
115
+ } else {
116
+ return nil
117
+ }
118
+ }()
119
+ }
120
+ @inline(__always)
121
+ set {
122
+ self.__dataAndroid = { () -> bridge.std__optional_std__string_ in
123
+ if let __unwrappedValue = newValue {
124
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
125
+ } else {
126
+ return .init()
127
+ }
128
+ }()
129
+ }
130
+ }
131
+
132
+ var developerPayloadAndroid: String? {
133
+ @inline(__always)
134
+ get {
135
+ return { () -> String? in
136
+ if bridge.has_value_std__optional_std__string_(self.__developerPayloadAndroid) {
137
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__developerPayloadAndroid)
138
+ return String(__unwrapped)
139
+ } else {
140
+ return nil
141
+ }
142
+ }()
143
+ }
144
+ @inline(__always)
145
+ set {
146
+ self.__developerPayloadAndroid = { () -> bridge.std__optional_std__string_ in
147
+ if let __unwrappedValue = newValue {
148
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
149
+ } else {
150
+ return .init()
151
+ }
152
+ }()
153
+ }
154
+ }
155
+
156
+ var id: String {
157
+ @inline(__always)
158
+ get {
159
+ return String(self.__id)
160
+ }
161
+ @inline(__always)
162
+ set {
163
+ self.__id = std.string(newValue)
164
+ }
165
+ }
166
+
167
+ var ids: [String]? {
168
+ @inline(__always)
169
+ get {
170
+ return { () -> [String]? in
171
+ if bridge.has_value_std__optional_std__vector_std__string__(self.__ids) {
172
+ let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__ids)
173
+ return __unwrapped.map({ __item in String(__item) })
174
+ } else {
175
+ return nil
176
+ }
177
+ }()
178
+ }
179
+ @inline(__always)
180
+ set {
181
+ self.__ids = { () -> bridge.std__optional_std__vector_std__string__ in
182
+ if let __unwrappedValue = newValue {
183
+ return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
184
+ var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
185
+ for __item in __unwrappedValue {
186
+ __vector.push_back(std.string(__item))
187
+ }
188
+ return __vector
189
+ }())
190
+ } else {
191
+ return .init()
192
+ }
193
+ }()
194
+ }
195
+ }
196
+
197
+ var isAcknowledgedAndroid: Bool? {
198
+ @inline(__always)
199
+ get {
200
+ return self.__isAcknowledgedAndroid.value
201
+ }
202
+ @inline(__always)
203
+ set {
204
+ self.__isAcknowledgedAndroid = { () -> bridge.std__optional_bool_ in
205
+ if let __unwrappedValue = newValue {
206
+ return bridge.create_std__optional_bool_(__unwrappedValue)
207
+ } else {
208
+ return .init()
209
+ }
210
+ }()
211
+ }
212
+ }
213
+
214
+ var isAutoRenewing: Bool {
215
+ @inline(__always)
216
+ get {
217
+ return self.__isAutoRenewing
218
+ }
219
+ @inline(__always)
220
+ set {
221
+ self.__isAutoRenewing = newValue
222
+ }
223
+ }
224
+
225
+ var obfuscatedAccountIdAndroid: String? {
226
+ @inline(__always)
227
+ get {
228
+ return { () -> String? in
229
+ if bridge.has_value_std__optional_std__string_(self.__obfuscatedAccountIdAndroid) {
230
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__obfuscatedAccountIdAndroid)
231
+ return String(__unwrapped)
232
+ } else {
233
+ return nil
234
+ }
235
+ }()
236
+ }
237
+ @inline(__always)
238
+ set {
239
+ self.__obfuscatedAccountIdAndroid = { () -> 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 obfuscatedProfileIdAndroid: String? {
250
+ @inline(__always)
251
+ get {
252
+ return { () -> String? in
253
+ if bridge.has_value_std__optional_std__string_(self.__obfuscatedProfileIdAndroid) {
254
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__obfuscatedProfileIdAndroid)
255
+ return String(__unwrapped)
256
+ } else {
257
+ return nil
258
+ }
259
+ }()
260
+ }
261
+ @inline(__always)
262
+ set {
263
+ self.__obfuscatedProfileIdAndroid = { () -> 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 packageNameAndroid: String? {
274
+ @inline(__always)
275
+ get {
276
+ return { () -> String? in
277
+ if bridge.has_value_std__optional_std__string_(self.__packageNameAndroid) {
278
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__packageNameAndroid)
279
+ return String(__unwrapped)
280
+ } else {
281
+ return nil
282
+ }
283
+ }()
284
+ }
285
+ @inline(__always)
286
+ set {
287
+ self.__packageNameAndroid = { () -> 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
+
297
+ var platform: IapPlatform {
298
+ @inline(__always)
299
+ get {
300
+ return self.__platform
301
+ }
302
+ @inline(__always)
303
+ set {
304
+ self.__platform = newValue
305
+ }
306
+ }
307
+
308
+ var productId: String {
309
+ @inline(__always)
310
+ get {
311
+ return String(self.__productId)
312
+ }
313
+ @inline(__always)
314
+ set {
315
+ self.__productId = std.string(newValue)
316
+ }
317
+ }
318
+
319
+ var purchaseState: PurchaseState {
320
+ @inline(__always)
321
+ get {
322
+ return self.__purchaseState
323
+ }
324
+ @inline(__always)
325
+ set {
326
+ self.__purchaseState = newValue
327
+ }
328
+ }
329
+
330
+ var purchaseToken: String? {
331
+ @inline(__always)
332
+ get {
333
+ return { () -> String? in
334
+ if bridge.has_value_std__optional_std__string_(self.__purchaseToken) {
335
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__purchaseToken)
336
+ return String(__unwrapped)
337
+ } else {
338
+ return nil
339
+ }
340
+ }()
341
+ }
342
+ @inline(__always)
343
+ set {
344
+ self.__purchaseToken = { () -> bridge.std__optional_std__string_ in
345
+ if let __unwrappedValue = newValue {
346
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
347
+ } else {
348
+ return .init()
349
+ }
350
+ }()
351
+ }
352
+ }
353
+
354
+ var quantity: Double {
355
+ @inline(__always)
356
+ get {
357
+ return self.__quantity
358
+ }
359
+ @inline(__always)
360
+ set {
361
+ self.__quantity = newValue
362
+ }
363
+ }
364
+
365
+ var signatureAndroid: String? {
366
+ @inline(__always)
367
+ get {
368
+ return { () -> String? in
369
+ if bridge.has_value_std__optional_std__string_(self.__signatureAndroid) {
370
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__signatureAndroid)
371
+ return String(__unwrapped)
372
+ } else {
373
+ return nil
374
+ }
375
+ }()
376
+ }
377
+ @inline(__always)
378
+ set {
379
+ self.__signatureAndroid = { () -> bridge.std__optional_std__string_ in
380
+ if let __unwrappedValue = newValue {
381
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
382
+ } else {
383
+ return .init()
384
+ }
385
+ }()
386
+ }
387
+ }
388
+
389
+ var transactionDate: Double {
390
+ @inline(__always)
391
+ get {
392
+ return self.__transactionDate
393
+ }
394
+ @inline(__always)
395
+ set {
396
+ self.__transactionDate = newValue
397
+ }
398
+ }
399
+ }