react-native-iap 14.4.10 → 14.4.12
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 +195 -12
- package/ios/HybridRnIap.swift +115 -2
- package/ios/RnIapHelper.swift +32 -1
- package/lib/module/hooks/useIAP.js +24 -3
- package/lib/module/hooks/useIAP.js.map +1 -1
- package/lib/module/index.js +275 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js +18 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/type-bridge.js +39 -1
- package/lib/module/utils/type-bridge.js.map +1 -1
- package/lib/typescript/plugin/src/withIAP.d.ts +27 -0
- package/lib/typescript/plugin/src/withIAP.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useIAP.d.ts +6 -1
- package/lib/typescript/src/hooks/useIAP.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +133 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/RnIap.nitro.d.ts +101 -2
- package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +116 -13
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/type-bridge.d.ts.map +1 -1
- package/nitrogen/generated/android/NitroIapOnLoad.cpp +2 -0
- package/nitrogen/generated/android/c++/JAlternativeBillingModeAndroid.hpp +62 -0
- package/nitrogen/generated/android/c++/JExternalPurchaseLinkResultIOS.hpp +58 -0
- package/nitrogen/generated/android/c++/JExternalPurchaseNoticeAction.hpp +59 -0
- package/nitrogen/generated/android/c++/JExternalPurchaseNoticeResultIOS.hpp +60 -0
- package/nitrogen/generated/android/c++/JFunc_void_NitroProduct.hpp +2 -0
- package/nitrogen/generated/android/c++/JFunc_void_UserChoiceBillingDetails.hpp +78 -0
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +136 -3
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.hpp +9 -1
- package/nitrogen/generated/android/c++/JInitConnectionConfig.hpp +55 -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/c++/JPurchaseAndroid.hpp +4 -0
- package/nitrogen/generated/android/c++/JPurchaseIOS.hpp +4 -0
- package/nitrogen/generated/android/c++/JUserChoiceBillingDetails.hpp +75 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/AlternativeBillingModeAndroid.kt +22 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/ExternalPurchaseLinkResultIOS.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/ExternalPurchaseNoticeAction.kt +21 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/ExternalPurchaseNoticeResultIOS.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Func_void_UserChoiceBillingDetails.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +43 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/InitConnectionConfig.kt +29 -0
- 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/android/kotlin/com/margelo/nitro/iap/PurchaseAndroid.kt +3 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseIOS.kt +3 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/UserChoiceBillingDetails.kt +32 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.cpp +24 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +174 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +21 -0
- package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +84 -3
- package/nitrogen/generated/ios/swift/AlternativeBillingModeAndroid.swift +44 -0
- package/nitrogen/generated/ios/swift/ExternalPurchaseLinkResultIOS.swift +65 -0
- package/nitrogen/generated/ios/swift/ExternalPurchaseNoticeAction.swift +40 -0
- package/nitrogen/generated/ios/swift/ExternalPurchaseNoticeResultIOS.swift +65 -0
- package/nitrogen/generated/ios/swift/Func_void_ExternalPurchaseLinkResultIOS.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_ExternalPurchaseNoticeResultIOS.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_UserChoiceBillingDetails.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +9 -1
- package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +168 -2
- package/nitrogen/generated/ios/swift/InitConnectionConfig.swift +47 -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/ios/swift/PurchaseAndroid.swift +31 -1
- package/nitrogen/generated/ios/swift/PurchaseIOS.swift +31 -1
- package/nitrogen/generated/ios/swift/UserChoiceBillingDetails.swift +58 -0
- package/nitrogen/generated/shared/c++/AlternativeBillingModeAndroid.hpp +80 -0
- package/nitrogen/generated/shared/c++/ExternalPurchaseLinkResultIOS.hpp +72 -0
- package/nitrogen/generated/shared/c++/ExternalPurchaseNoticeAction.hpp +76 -0
- package/nitrogen/generated/shared/c++/ExternalPurchaseNoticeResultIOS.hpp +74 -0
- package/nitrogen/generated/shared/c++/HybridRnIapSpec.cpp +8 -0
- package/nitrogen/generated/shared/c++/HybridRnIapSpec.hpp +22 -2
- package/nitrogen/generated/shared/c++/InitConnectionConfig.hpp +69 -0
- 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/nitrogen/generated/shared/c++/PurchaseAndroid.hpp +5 -1
- package/nitrogen/generated/shared/c++/PurchaseIOS.hpp +5 -1
- package/nitrogen/generated/shared/c++/UserChoiceBillingDetails.hpp +72 -0
- package/openiap-versions.json +3 -3
- package/package.json +3 -3
- package/plugin/build/withIAP.d.ts +27 -0
- package/plugin/build/withIAP.js +91 -1
- package/plugin/src/withIAP.ts +162 -0
- package/src/hooks/useIAP.ts +47 -1
- package/src/index.ts +313 -2
- package/src/specs/RnIap.nitro.ts +131 -1
- package/src/types.ts +124 -13
- package/src/utils/type-bridge.ts +76 -16
|
@@ -8,12 +8,22 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `AlternativeBillingModeAndroid` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::iap { enum class AlternativeBillingModeAndroid; }
|
|
11
13
|
// Forward declaration of `AndroidSubscriptionOfferInput` to properly resolve imports.
|
|
12
14
|
namespace margelo::nitro::iap { struct AndroidSubscriptionOfferInput; }
|
|
15
|
+
// Forward declaration of `ExternalPurchaseLinkResultIOS` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::iap { struct ExternalPurchaseLinkResultIOS; }
|
|
17
|
+
// Forward declaration of `ExternalPurchaseNoticeAction` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::iap { enum class ExternalPurchaseNoticeAction; }
|
|
19
|
+
// Forward declaration of `ExternalPurchaseNoticeResultIOS` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::iap { struct ExternalPurchaseNoticeResultIOS; }
|
|
13
21
|
// Forward declaration of `HybridRnIapSpec` to properly resolve imports.
|
|
14
22
|
namespace margelo::nitro::iap { class HybridRnIapSpec; }
|
|
15
23
|
// Forward declaration of `IapPlatform` to properly resolve imports.
|
|
16
24
|
namespace margelo::nitro::iap { enum class IapPlatform; }
|
|
25
|
+
// Forward declaration of `InitConnectionConfig` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::iap { struct InitConnectionConfig; }
|
|
17
27
|
// Forward declaration of `NitroAvailablePurchasesAndroidOptions` to properly resolve imports.
|
|
18
28
|
namespace margelo::nitro::iap { struct NitroAvailablePurchasesAndroidOptions; }
|
|
19
29
|
// Forward declaration of `NitroAvailablePurchasesAndroidType` to properly resolve imports.
|
|
@@ -26,6 +36,8 @@ namespace margelo::nitro::iap { struct NitroAvailablePurchasesOptions; }
|
|
|
26
36
|
namespace margelo::nitro::iap { struct NitroFinishTransactionAndroidParams; }
|
|
27
37
|
// Forward declaration of `NitroFinishTransactionIosParams` to properly resolve imports.
|
|
28
38
|
namespace margelo::nitro::iap { struct NitroFinishTransactionIosParams; }
|
|
39
|
+
// Forward declaration of `NitroOneTimePurchaseOfferDetail` to properly resolve imports.
|
|
40
|
+
namespace margelo::nitro::iap { struct NitroOneTimePurchaseOfferDetail; }
|
|
29
41
|
// Forward declaration of `NitroProduct` to properly resolve imports.
|
|
30
42
|
namespace margelo::nitro::iap { struct NitroProduct; }
|
|
31
43
|
// Forward declaration of `NitroPurchaseResult` to properly resolve imports.
|
|
@@ -54,21 +66,29 @@ namespace margelo::nitro::iap { struct PurchaseIOS; }
|
|
|
54
66
|
namespace margelo::nitro::iap { struct PurchaseOfferIOS; }
|
|
55
67
|
// Forward declaration of `PurchaseState` to properly resolve imports.
|
|
56
68
|
namespace margelo::nitro::iap { enum class PurchaseState; }
|
|
69
|
+
// Forward declaration of `UserChoiceBillingDetails` to properly resolve imports.
|
|
70
|
+
namespace margelo::nitro::iap { struct UserChoiceBillingDetails; }
|
|
57
71
|
|
|
58
72
|
// Forward declarations of Swift defined types
|
|
59
73
|
// Forward declaration of `HybridRnIapSpec_cxx` to properly resolve imports.
|
|
60
74
|
namespace NitroIap { class HybridRnIapSpec_cxx; }
|
|
61
75
|
|
|
62
76
|
// Include C++ defined types
|
|
77
|
+
#include "AlternativeBillingModeAndroid.hpp"
|
|
63
78
|
#include "AndroidSubscriptionOfferInput.hpp"
|
|
79
|
+
#include "ExternalPurchaseLinkResultIOS.hpp"
|
|
80
|
+
#include "ExternalPurchaseNoticeAction.hpp"
|
|
81
|
+
#include "ExternalPurchaseNoticeResultIOS.hpp"
|
|
64
82
|
#include "HybridRnIapSpec.hpp"
|
|
65
83
|
#include "IapPlatform.hpp"
|
|
84
|
+
#include "InitConnectionConfig.hpp"
|
|
66
85
|
#include "NitroAvailablePurchasesAndroidOptions.hpp"
|
|
67
86
|
#include "NitroAvailablePurchasesAndroidType.hpp"
|
|
68
87
|
#include "NitroAvailablePurchasesIosOptions.hpp"
|
|
69
88
|
#include "NitroAvailablePurchasesOptions.hpp"
|
|
70
89
|
#include "NitroFinishTransactionAndroidParams.hpp"
|
|
71
90
|
#include "NitroFinishTransactionIosParams.hpp"
|
|
91
|
+
#include "NitroOneTimePurchaseOfferDetail.hpp"
|
|
72
92
|
#include "NitroProduct.hpp"
|
|
73
93
|
#include "NitroPurchase.hpp"
|
|
74
94
|
#include "NitroPurchaseResult.hpp"
|
|
@@ -83,6 +103,7 @@ namespace NitroIap { class HybridRnIapSpec_cxx; }
|
|
|
83
103
|
#include "PurchaseIOS.hpp"
|
|
84
104
|
#include "PurchaseOfferIOS.hpp"
|
|
85
105
|
#include "PurchaseState.hpp"
|
|
106
|
+
#include "UserChoiceBillingDetails.hpp"
|
|
86
107
|
#include <NitroModules/Promise.hpp>
|
|
87
108
|
#include <NitroModules/PromiseHolder.hpp>
|
|
88
109
|
#include <NitroModules/Result.hpp>
|
|
@@ -157,6 +178,36 @@ namespace margelo::nitro::iap::bridge::swift {
|
|
|
157
178
|
return Func_void_std__exception_ptr_Wrapper(std::move(value));
|
|
158
179
|
}
|
|
159
180
|
|
|
181
|
+
// pragma MARK: std::optional<AlternativeBillingModeAndroid>
|
|
182
|
+
/**
|
|
183
|
+
* Specialized version of `std::optional<AlternativeBillingModeAndroid>`.
|
|
184
|
+
*/
|
|
185
|
+
using std__optional_AlternativeBillingModeAndroid_ = std::optional<AlternativeBillingModeAndroid>;
|
|
186
|
+
inline std::optional<AlternativeBillingModeAndroid> create_std__optional_AlternativeBillingModeAndroid_(const AlternativeBillingModeAndroid& value) noexcept {
|
|
187
|
+
return std::optional<AlternativeBillingModeAndroid>(value);
|
|
188
|
+
}
|
|
189
|
+
inline bool has_value_std__optional_AlternativeBillingModeAndroid_(const std::optional<AlternativeBillingModeAndroid>& optional) noexcept {
|
|
190
|
+
return optional.has_value();
|
|
191
|
+
}
|
|
192
|
+
inline AlternativeBillingModeAndroid get_std__optional_AlternativeBillingModeAndroid_(const std::optional<AlternativeBillingModeAndroid>& optional) noexcept {
|
|
193
|
+
return *optional;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// pragma MARK: std::optional<InitConnectionConfig>
|
|
197
|
+
/**
|
|
198
|
+
* Specialized version of `std::optional<InitConnectionConfig>`.
|
|
199
|
+
*/
|
|
200
|
+
using std__optional_InitConnectionConfig_ = std::optional<InitConnectionConfig>;
|
|
201
|
+
inline std::optional<InitConnectionConfig> create_std__optional_InitConnectionConfig_(const InitConnectionConfig& value) noexcept {
|
|
202
|
+
return std::optional<InitConnectionConfig>(value);
|
|
203
|
+
}
|
|
204
|
+
inline bool has_value_std__optional_InitConnectionConfig_(const std::optional<InitConnectionConfig>& optional) noexcept {
|
|
205
|
+
return optional.has_value();
|
|
206
|
+
}
|
|
207
|
+
inline InitConnectionConfig get_std__optional_InitConnectionConfig_(const std::optional<InitConnectionConfig>& optional) noexcept {
|
|
208
|
+
return *optional;
|
|
209
|
+
}
|
|
210
|
+
|
|
160
211
|
// pragma MARK: std::optional<std::string>
|
|
161
212
|
/**
|
|
162
213
|
* Specialized version of `std::optional<std::string>`.
|
|
@@ -202,6 +253,21 @@ namespace margelo::nitro::iap::bridge::swift {
|
|
|
202
253
|
return *optional;
|
|
203
254
|
}
|
|
204
255
|
|
|
256
|
+
// pragma MARK: std::optional<NitroOneTimePurchaseOfferDetail>
|
|
257
|
+
/**
|
|
258
|
+
* Specialized version of `std::optional<NitroOneTimePurchaseOfferDetail>`.
|
|
259
|
+
*/
|
|
260
|
+
using std__optional_NitroOneTimePurchaseOfferDetail_ = std::optional<NitroOneTimePurchaseOfferDetail>;
|
|
261
|
+
inline std::optional<NitroOneTimePurchaseOfferDetail> create_std__optional_NitroOneTimePurchaseOfferDetail_(const NitroOneTimePurchaseOfferDetail& value) noexcept {
|
|
262
|
+
return std::optional<NitroOneTimePurchaseOfferDetail>(value);
|
|
263
|
+
}
|
|
264
|
+
inline bool has_value_std__optional_NitroOneTimePurchaseOfferDetail_(const std::optional<NitroOneTimePurchaseOfferDetail>& optional) noexcept {
|
|
265
|
+
return optional.has_value();
|
|
266
|
+
}
|
|
267
|
+
inline NitroOneTimePurchaseOfferDetail get_std__optional_NitroOneTimePurchaseOfferDetail_(const std::optional<NitroOneTimePurchaseOfferDetail>& optional) noexcept {
|
|
268
|
+
return *optional;
|
|
269
|
+
}
|
|
270
|
+
|
|
205
271
|
// pragma MARK: std::vector<NitroProduct>
|
|
206
272
|
/**
|
|
207
273
|
* Specialized version of `std::vector<NitroProduct>`.
|
|
@@ -1125,6 +1191,96 @@ namespace margelo::nitro::iap::bridge::swift {
|
|
|
1125
1191
|
return *optional;
|
|
1126
1192
|
}
|
|
1127
1193
|
|
|
1194
|
+
// pragma MARK: std::function<void(const UserChoiceBillingDetails& /* details */)>
|
|
1195
|
+
/**
|
|
1196
|
+
* Specialized version of `std::function<void(const UserChoiceBillingDetails&)>`.
|
|
1197
|
+
*/
|
|
1198
|
+
using Func_void_UserChoiceBillingDetails = std::function<void(const UserChoiceBillingDetails& /* details */)>;
|
|
1199
|
+
/**
|
|
1200
|
+
* Wrapper class for a `std::function<void(const UserChoiceBillingDetails& / * details * /)>`, this can be used from Swift.
|
|
1201
|
+
*/
|
|
1202
|
+
class Func_void_UserChoiceBillingDetails_Wrapper final {
|
|
1203
|
+
public:
|
|
1204
|
+
explicit Func_void_UserChoiceBillingDetails_Wrapper(std::function<void(const UserChoiceBillingDetails& /* details */)>&& func): _function(std::make_unique<std::function<void(const UserChoiceBillingDetails& /* details */)>>(std::move(func))) {}
|
|
1205
|
+
inline void call(UserChoiceBillingDetails details) const noexcept {
|
|
1206
|
+
_function->operator()(details);
|
|
1207
|
+
}
|
|
1208
|
+
private:
|
|
1209
|
+
std::unique_ptr<std::function<void(const UserChoiceBillingDetails& /* details */)>> _function;
|
|
1210
|
+
} SWIFT_NONCOPYABLE;
|
|
1211
|
+
Func_void_UserChoiceBillingDetails create_Func_void_UserChoiceBillingDetails(void* _Nonnull swiftClosureWrapper) noexcept;
|
|
1212
|
+
inline Func_void_UserChoiceBillingDetails_Wrapper wrap_Func_void_UserChoiceBillingDetails(Func_void_UserChoiceBillingDetails value) noexcept {
|
|
1213
|
+
return Func_void_UserChoiceBillingDetails_Wrapper(std::move(value));
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
// pragma MARK: std::shared_ptr<Promise<ExternalPurchaseNoticeResultIOS>>
|
|
1217
|
+
/**
|
|
1218
|
+
* Specialized version of `std::shared_ptr<Promise<ExternalPurchaseNoticeResultIOS>>`.
|
|
1219
|
+
*/
|
|
1220
|
+
using std__shared_ptr_Promise_ExternalPurchaseNoticeResultIOS__ = std::shared_ptr<Promise<ExternalPurchaseNoticeResultIOS>>;
|
|
1221
|
+
inline std::shared_ptr<Promise<ExternalPurchaseNoticeResultIOS>> create_std__shared_ptr_Promise_ExternalPurchaseNoticeResultIOS__() noexcept {
|
|
1222
|
+
return Promise<ExternalPurchaseNoticeResultIOS>::create();
|
|
1223
|
+
}
|
|
1224
|
+
inline PromiseHolder<ExternalPurchaseNoticeResultIOS> wrap_std__shared_ptr_Promise_ExternalPurchaseNoticeResultIOS__(std::shared_ptr<Promise<ExternalPurchaseNoticeResultIOS>> promise) noexcept {
|
|
1225
|
+
return PromiseHolder<ExternalPurchaseNoticeResultIOS>(std::move(promise));
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
// pragma MARK: std::function<void(const ExternalPurchaseNoticeResultIOS& /* result */)>
|
|
1229
|
+
/**
|
|
1230
|
+
* Specialized version of `std::function<void(const ExternalPurchaseNoticeResultIOS&)>`.
|
|
1231
|
+
*/
|
|
1232
|
+
using Func_void_ExternalPurchaseNoticeResultIOS = std::function<void(const ExternalPurchaseNoticeResultIOS& /* result */)>;
|
|
1233
|
+
/**
|
|
1234
|
+
* Wrapper class for a `std::function<void(const ExternalPurchaseNoticeResultIOS& / * result * /)>`, this can be used from Swift.
|
|
1235
|
+
*/
|
|
1236
|
+
class Func_void_ExternalPurchaseNoticeResultIOS_Wrapper final {
|
|
1237
|
+
public:
|
|
1238
|
+
explicit Func_void_ExternalPurchaseNoticeResultIOS_Wrapper(std::function<void(const ExternalPurchaseNoticeResultIOS& /* result */)>&& func): _function(std::make_unique<std::function<void(const ExternalPurchaseNoticeResultIOS& /* result */)>>(std::move(func))) {}
|
|
1239
|
+
inline void call(ExternalPurchaseNoticeResultIOS result) const noexcept {
|
|
1240
|
+
_function->operator()(result);
|
|
1241
|
+
}
|
|
1242
|
+
private:
|
|
1243
|
+
std::unique_ptr<std::function<void(const ExternalPurchaseNoticeResultIOS& /* result */)>> _function;
|
|
1244
|
+
} SWIFT_NONCOPYABLE;
|
|
1245
|
+
Func_void_ExternalPurchaseNoticeResultIOS create_Func_void_ExternalPurchaseNoticeResultIOS(void* _Nonnull swiftClosureWrapper) noexcept;
|
|
1246
|
+
inline Func_void_ExternalPurchaseNoticeResultIOS_Wrapper wrap_Func_void_ExternalPurchaseNoticeResultIOS(Func_void_ExternalPurchaseNoticeResultIOS value) noexcept {
|
|
1247
|
+
return Func_void_ExternalPurchaseNoticeResultIOS_Wrapper(std::move(value));
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
// pragma MARK: std::shared_ptr<Promise<ExternalPurchaseLinkResultIOS>>
|
|
1251
|
+
/**
|
|
1252
|
+
* Specialized version of `std::shared_ptr<Promise<ExternalPurchaseLinkResultIOS>>`.
|
|
1253
|
+
*/
|
|
1254
|
+
using std__shared_ptr_Promise_ExternalPurchaseLinkResultIOS__ = std::shared_ptr<Promise<ExternalPurchaseLinkResultIOS>>;
|
|
1255
|
+
inline std::shared_ptr<Promise<ExternalPurchaseLinkResultIOS>> create_std__shared_ptr_Promise_ExternalPurchaseLinkResultIOS__() noexcept {
|
|
1256
|
+
return Promise<ExternalPurchaseLinkResultIOS>::create();
|
|
1257
|
+
}
|
|
1258
|
+
inline PromiseHolder<ExternalPurchaseLinkResultIOS> wrap_std__shared_ptr_Promise_ExternalPurchaseLinkResultIOS__(std::shared_ptr<Promise<ExternalPurchaseLinkResultIOS>> promise) noexcept {
|
|
1259
|
+
return PromiseHolder<ExternalPurchaseLinkResultIOS>(std::move(promise));
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
// pragma MARK: std::function<void(const ExternalPurchaseLinkResultIOS& /* result */)>
|
|
1263
|
+
/**
|
|
1264
|
+
* Specialized version of `std::function<void(const ExternalPurchaseLinkResultIOS&)>`.
|
|
1265
|
+
*/
|
|
1266
|
+
using Func_void_ExternalPurchaseLinkResultIOS = std::function<void(const ExternalPurchaseLinkResultIOS& /* result */)>;
|
|
1267
|
+
/**
|
|
1268
|
+
* Wrapper class for a `std::function<void(const ExternalPurchaseLinkResultIOS& / * result * /)>`, this can be used from Swift.
|
|
1269
|
+
*/
|
|
1270
|
+
class Func_void_ExternalPurchaseLinkResultIOS_Wrapper final {
|
|
1271
|
+
public:
|
|
1272
|
+
explicit Func_void_ExternalPurchaseLinkResultIOS_Wrapper(std::function<void(const ExternalPurchaseLinkResultIOS& /* result */)>&& func): _function(std::make_unique<std::function<void(const ExternalPurchaseLinkResultIOS& /* result */)>>(std::move(func))) {}
|
|
1273
|
+
inline void call(ExternalPurchaseLinkResultIOS result) const noexcept {
|
|
1274
|
+
_function->operator()(result);
|
|
1275
|
+
}
|
|
1276
|
+
private:
|
|
1277
|
+
std::unique_ptr<std::function<void(const ExternalPurchaseLinkResultIOS& /* result */)>> _function;
|
|
1278
|
+
} SWIFT_NONCOPYABLE;
|
|
1279
|
+
Func_void_ExternalPurchaseLinkResultIOS create_Func_void_ExternalPurchaseLinkResultIOS(void* _Nonnull swiftClosureWrapper) noexcept;
|
|
1280
|
+
inline Func_void_ExternalPurchaseLinkResultIOS_Wrapper wrap_Func_void_ExternalPurchaseLinkResultIOS(Func_void_ExternalPurchaseLinkResultIOS value) noexcept {
|
|
1281
|
+
return Func_void_ExternalPurchaseLinkResultIOS_Wrapper(std::move(value));
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1128
1284
|
// pragma MARK: std::shared_ptr<HybridRnIapSpec>
|
|
1129
1285
|
/**
|
|
1130
1286
|
* Specialized version of `std::shared_ptr<HybridRnIapSpec>`.
|
|
@@ -1253,5 +1409,23 @@ namespace margelo::nitro::iap::bridge::swift {
|
|
|
1253
1409
|
inline Result_std__shared_ptr_Promise_std__variant_NitroReceiptValidationResultIOS__NitroReceiptValidationResultAndroid____ create_Result_std__shared_ptr_Promise_std__variant_NitroReceiptValidationResultIOS__NitroReceiptValidationResultAndroid____(const std::exception_ptr& error) noexcept {
|
|
1254
1410
|
return Result<std::shared_ptr<Promise<std::variant<NitroReceiptValidationResultIOS, NitroReceiptValidationResultAndroid>>>>::withError(error);
|
|
1255
1411
|
}
|
|
1412
|
+
|
|
1413
|
+
// pragma MARK: Result<std::shared_ptr<Promise<ExternalPurchaseNoticeResultIOS>>>
|
|
1414
|
+
using Result_std__shared_ptr_Promise_ExternalPurchaseNoticeResultIOS___ = Result<std::shared_ptr<Promise<ExternalPurchaseNoticeResultIOS>>>;
|
|
1415
|
+
inline Result_std__shared_ptr_Promise_ExternalPurchaseNoticeResultIOS___ create_Result_std__shared_ptr_Promise_ExternalPurchaseNoticeResultIOS___(const std::shared_ptr<Promise<ExternalPurchaseNoticeResultIOS>>& value) noexcept {
|
|
1416
|
+
return Result<std::shared_ptr<Promise<ExternalPurchaseNoticeResultIOS>>>::withValue(value);
|
|
1417
|
+
}
|
|
1418
|
+
inline Result_std__shared_ptr_Promise_ExternalPurchaseNoticeResultIOS___ create_Result_std__shared_ptr_Promise_ExternalPurchaseNoticeResultIOS___(const std::exception_ptr& error) noexcept {
|
|
1419
|
+
return Result<std::shared_ptr<Promise<ExternalPurchaseNoticeResultIOS>>>::withError(error);
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
// pragma MARK: Result<std::shared_ptr<Promise<ExternalPurchaseLinkResultIOS>>>
|
|
1423
|
+
using Result_std__shared_ptr_Promise_ExternalPurchaseLinkResultIOS___ = Result<std::shared_ptr<Promise<ExternalPurchaseLinkResultIOS>>>;
|
|
1424
|
+
inline Result_std__shared_ptr_Promise_ExternalPurchaseLinkResultIOS___ create_Result_std__shared_ptr_Promise_ExternalPurchaseLinkResultIOS___(const std::shared_ptr<Promise<ExternalPurchaseLinkResultIOS>>& value) noexcept {
|
|
1425
|
+
return Result<std::shared_ptr<Promise<ExternalPurchaseLinkResultIOS>>>::withValue(value);
|
|
1426
|
+
}
|
|
1427
|
+
inline Result_std__shared_ptr_Promise_ExternalPurchaseLinkResultIOS___ create_Result_std__shared_ptr_Promise_ExternalPurchaseLinkResultIOS___(const std::exception_ptr& error) noexcept {
|
|
1428
|
+
return Result<std::shared_ptr<Promise<ExternalPurchaseLinkResultIOS>>>::withError(error);
|
|
1429
|
+
}
|
|
1256
1430
|
|
|
1257
1431
|
} // namespace margelo::nitro::iap::bridge::swift
|
|
@@ -8,12 +8,22 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `AlternativeBillingModeAndroid` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::iap { enum class AlternativeBillingModeAndroid; }
|
|
11
13
|
// Forward declaration of `AndroidSubscriptionOfferInput` to properly resolve imports.
|
|
12
14
|
namespace margelo::nitro::iap { struct AndroidSubscriptionOfferInput; }
|
|
15
|
+
// Forward declaration of `ExternalPurchaseLinkResultIOS` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::iap { struct ExternalPurchaseLinkResultIOS; }
|
|
17
|
+
// Forward declaration of `ExternalPurchaseNoticeAction` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::iap { enum class ExternalPurchaseNoticeAction; }
|
|
19
|
+
// Forward declaration of `ExternalPurchaseNoticeResultIOS` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::iap { struct ExternalPurchaseNoticeResultIOS; }
|
|
13
21
|
// Forward declaration of `HybridRnIapSpec` to properly resolve imports.
|
|
14
22
|
namespace margelo::nitro::iap { class HybridRnIapSpec; }
|
|
15
23
|
// Forward declaration of `IapPlatform` to properly resolve imports.
|
|
16
24
|
namespace margelo::nitro::iap { enum class IapPlatform; }
|
|
25
|
+
// Forward declaration of `InitConnectionConfig` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::iap { struct InitConnectionConfig; }
|
|
17
27
|
// Forward declaration of `NitroAvailablePurchasesAndroidOptions` to properly resolve imports.
|
|
18
28
|
namespace margelo::nitro::iap { struct NitroAvailablePurchasesAndroidOptions; }
|
|
19
29
|
// Forward declaration of `NitroAvailablePurchasesAndroidType` to properly resolve imports.
|
|
@@ -30,6 +40,8 @@ namespace margelo::nitro::iap { struct NitroFinishTransactionAndroidParams; }
|
|
|
30
40
|
namespace margelo::nitro::iap { struct NitroFinishTransactionIosParams; }
|
|
31
41
|
// Forward declaration of `NitroFinishTransactionParams` to properly resolve imports.
|
|
32
42
|
namespace margelo::nitro::iap { struct NitroFinishTransactionParams; }
|
|
43
|
+
// Forward declaration of `NitroOneTimePurchaseOfferDetail` to properly resolve imports.
|
|
44
|
+
namespace margelo::nitro::iap { struct NitroOneTimePurchaseOfferDetail; }
|
|
33
45
|
// Forward declaration of `NitroProduct` to properly resolve imports.
|
|
34
46
|
namespace margelo::nitro::iap { struct NitroProduct; }
|
|
35
47
|
// Forward declaration of `NitroPurchaseRequest` to properly resolve imports.
|
|
@@ -62,11 +74,18 @@ namespace margelo::nitro::iap { struct PurchaseIOS; }
|
|
|
62
74
|
namespace margelo::nitro::iap { struct PurchaseOfferIOS; }
|
|
63
75
|
// Forward declaration of `PurchaseState` to properly resolve imports.
|
|
64
76
|
namespace margelo::nitro::iap { enum class PurchaseState; }
|
|
77
|
+
// Forward declaration of `UserChoiceBillingDetails` to properly resolve imports.
|
|
78
|
+
namespace margelo::nitro::iap { struct UserChoiceBillingDetails; }
|
|
65
79
|
|
|
66
80
|
// Include C++ defined types
|
|
81
|
+
#include "AlternativeBillingModeAndroid.hpp"
|
|
67
82
|
#include "AndroidSubscriptionOfferInput.hpp"
|
|
83
|
+
#include "ExternalPurchaseLinkResultIOS.hpp"
|
|
84
|
+
#include "ExternalPurchaseNoticeAction.hpp"
|
|
85
|
+
#include "ExternalPurchaseNoticeResultIOS.hpp"
|
|
68
86
|
#include "HybridRnIapSpec.hpp"
|
|
69
87
|
#include "IapPlatform.hpp"
|
|
88
|
+
#include "InitConnectionConfig.hpp"
|
|
70
89
|
#include "NitroAvailablePurchasesAndroidOptions.hpp"
|
|
71
90
|
#include "NitroAvailablePurchasesAndroidType.hpp"
|
|
72
91
|
#include "NitroAvailablePurchasesIosOptions.hpp"
|
|
@@ -75,6 +94,7 @@ namespace margelo::nitro::iap { enum class PurchaseState; }
|
|
|
75
94
|
#include "NitroFinishTransactionAndroidParams.hpp"
|
|
76
95
|
#include "NitroFinishTransactionIosParams.hpp"
|
|
77
96
|
#include "NitroFinishTransactionParams.hpp"
|
|
97
|
+
#include "NitroOneTimePurchaseOfferDetail.hpp"
|
|
78
98
|
#include "NitroProduct.hpp"
|
|
79
99
|
#include "NitroPurchase.hpp"
|
|
80
100
|
#include "NitroPurchaseRequest.hpp"
|
|
@@ -91,6 +111,7 @@ namespace margelo::nitro::iap { enum class PurchaseState; }
|
|
|
91
111
|
#include "PurchaseIOS.hpp"
|
|
92
112
|
#include "PurchaseOfferIOS.hpp"
|
|
93
113
|
#include "PurchaseState.hpp"
|
|
114
|
+
#include "UserChoiceBillingDetails.hpp"
|
|
94
115
|
#include <NitroModules/Promise.hpp>
|
|
95
116
|
#include <NitroModules/Result.hpp>
|
|
96
117
|
#include <exception>
|
|
@@ -12,10 +12,16 @@
|
|
|
12
12
|
// Forward declaration of `HybridRnIapSpec_cxx` to properly resolve imports.
|
|
13
13
|
namespace NitroIap { class HybridRnIapSpec_cxx; }
|
|
14
14
|
|
|
15
|
+
// Forward declaration of `InitConnectionConfig` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::iap { struct InitConnectionConfig; }
|
|
17
|
+
// Forward declaration of `AlternativeBillingModeAndroid` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::iap { enum class AlternativeBillingModeAndroid; }
|
|
15
19
|
// Forward declaration of `NitroProduct` to properly resolve imports.
|
|
16
20
|
namespace margelo::nitro::iap { struct NitroProduct; }
|
|
17
21
|
// Forward declaration of `IapPlatform` to properly resolve imports.
|
|
18
22
|
namespace margelo::nitro::iap { enum class IapPlatform; }
|
|
23
|
+
// Forward declaration of `NitroOneTimePurchaseOfferDetail` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::iap { struct NitroOneTimePurchaseOfferDetail; }
|
|
19
25
|
// Forward declaration of `PurchaseAndroid` to properly resolve imports.
|
|
20
26
|
namespace margelo::nitro::iap { struct PurchaseAndroid; }
|
|
21
27
|
// Forward declaration of `PurchaseIOS` to properly resolve imports.
|
|
@@ -64,13 +70,24 @@ namespace margelo::nitro::iap { struct NitroReceiptValidationParams; }
|
|
|
64
70
|
namespace margelo::nitro::iap { struct NitroReceiptValidationAndroidOptions; }
|
|
65
71
|
// Forward declaration of `NitroDeepLinkOptionsAndroid` to properly resolve imports.
|
|
66
72
|
namespace margelo::nitro::iap { struct NitroDeepLinkOptionsAndroid; }
|
|
73
|
+
// Forward declaration of `UserChoiceBillingDetails` to properly resolve imports.
|
|
74
|
+
namespace margelo::nitro::iap { struct UserChoiceBillingDetails; }
|
|
75
|
+
// Forward declaration of `ExternalPurchaseNoticeResultIOS` to properly resolve imports.
|
|
76
|
+
namespace margelo::nitro::iap { struct ExternalPurchaseNoticeResultIOS; }
|
|
77
|
+
// Forward declaration of `ExternalPurchaseNoticeAction` to properly resolve imports.
|
|
78
|
+
namespace margelo::nitro::iap { enum class ExternalPurchaseNoticeAction; }
|
|
79
|
+
// Forward declaration of `ExternalPurchaseLinkResultIOS` to properly resolve imports.
|
|
80
|
+
namespace margelo::nitro::iap { struct ExternalPurchaseLinkResultIOS; }
|
|
67
81
|
|
|
68
82
|
#include <NitroModules/Promise.hpp>
|
|
83
|
+
#include "InitConnectionConfig.hpp"
|
|
84
|
+
#include <optional>
|
|
85
|
+
#include "AlternativeBillingModeAndroid.hpp"
|
|
69
86
|
#include "NitroProduct.hpp"
|
|
70
87
|
#include <vector>
|
|
71
88
|
#include <string>
|
|
72
|
-
#include <optional>
|
|
73
89
|
#include "IapPlatform.hpp"
|
|
90
|
+
#include "NitroOneTimePurchaseOfferDetail.hpp"
|
|
74
91
|
#include "PurchaseAndroid.hpp"
|
|
75
92
|
#include "PurchaseIOS.hpp"
|
|
76
93
|
#include <variant>
|
|
@@ -98,6 +115,10 @@ namespace margelo::nitro::iap { struct NitroDeepLinkOptionsAndroid; }
|
|
|
98
115
|
#include "NitroReceiptValidationParams.hpp"
|
|
99
116
|
#include "NitroReceiptValidationAndroidOptions.hpp"
|
|
100
117
|
#include "NitroDeepLinkOptionsAndroid.hpp"
|
|
118
|
+
#include "UserChoiceBillingDetails.hpp"
|
|
119
|
+
#include "ExternalPurchaseNoticeResultIOS.hpp"
|
|
120
|
+
#include "ExternalPurchaseNoticeAction.hpp"
|
|
121
|
+
#include "ExternalPurchaseLinkResultIOS.hpp"
|
|
101
122
|
|
|
102
123
|
#include "NitroIap-Swift-Cxx-Umbrella.hpp"
|
|
103
124
|
|
|
@@ -140,8 +161,8 @@ namespace margelo::nitro::iap {
|
|
|
140
161
|
|
|
141
162
|
public:
|
|
142
163
|
// Methods
|
|
143
|
-
inline std::shared_ptr<Promise<bool>> initConnection() override {
|
|
144
|
-
auto __result = _swiftPart.initConnection();
|
|
164
|
+
inline std::shared_ptr<Promise<bool>> initConnection(const std::optional<InitConnectionConfig>& config) override {
|
|
165
|
+
auto __result = _swiftPart.initConnection(config);
|
|
145
166
|
if (__result.hasError()) [[unlikely]] {
|
|
146
167
|
std::rethrow_exception(__result.error());
|
|
147
168
|
}
|
|
@@ -416,6 +437,66 @@ namespace margelo::nitro::iap {
|
|
|
416
437
|
auto __value = std::move(__result.value());
|
|
417
438
|
return __value;
|
|
418
439
|
}
|
|
440
|
+
inline std::shared_ptr<Promise<bool>> checkAlternativeBillingAvailabilityAndroid() override {
|
|
441
|
+
auto __result = _swiftPart.checkAlternativeBillingAvailabilityAndroid();
|
|
442
|
+
if (__result.hasError()) [[unlikely]] {
|
|
443
|
+
std::rethrow_exception(__result.error());
|
|
444
|
+
}
|
|
445
|
+
auto __value = std::move(__result.value());
|
|
446
|
+
return __value;
|
|
447
|
+
}
|
|
448
|
+
inline std::shared_ptr<Promise<bool>> showAlternativeBillingDialogAndroid() override {
|
|
449
|
+
auto __result = _swiftPart.showAlternativeBillingDialogAndroid();
|
|
450
|
+
if (__result.hasError()) [[unlikely]] {
|
|
451
|
+
std::rethrow_exception(__result.error());
|
|
452
|
+
}
|
|
453
|
+
auto __value = std::move(__result.value());
|
|
454
|
+
return __value;
|
|
455
|
+
}
|
|
456
|
+
inline std::shared_ptr<Promise<std::optional<std::string>>> createAlternativeBillingTokenAndroid(const std::optional<std::string>& sku) override {
|
|
457
|
+
auto __result = _swiftPart.createAlternativeBillingTokenAndroid(sku);
|
|
458
|
+
if (__result.hasError()) [[unlikely]] {
|
|
459
|
+
std::rethrow_exception(__result.error());
|
|
460
|
+
}
|
|
461
|
+
auto __value = std::move(__result.value());
|
|
462
|
+
return __value;
|
|
463
|
+
}
|
|
464
|
+
inline void addUserChoiceBillingListenerAndroid(const std::function<void(const UserChoiceBillingDetails& /* details */)>& listener) override {
|
|
465
|
+
auto __result = _swiftPart.addUserChoiceBillingListenerAndroid(listener);
|
|
466
|
+
if (__result.hasError()) [[unlikely]] {
|
|
467
|
+
std::rethrow_exception(__result.error());
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
inline void removeUserChoiceBillingListenerAndroid(const std::function<void(const UserChoiceBillingDetails& /* details */)>& listener) override {
|
|
471
|
+
auto __result = _swiftPart.removeUserChoiceBillingListenerAndroid(listener);
|
|
472
|
+
if (__result.hasError()) [[unlikely]] {
|
|
473
|
+
std::rethrow_exception(__result.error());
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
inline std::shared_ptr<Promise<bool>> canPresentExternalPurchaseNoticeIOS() override {
|
|
477
|
+
auto __result = _swiftPart.canPresentExternalPurchaseNoticeIOS();
|
|
478
|
+
if (__result.hasError()) [[unlikely]] {
|
|
479
|
+
std::rethrow_exception(__result.error());
|
|
480
|
+
}
|
|
481
|
+
auto __value = std::move(__result.value());
|
|
482
|
+
return __value;
|
|
483
|
+
}
|
|
484
|
+
inline std::shared_ptr<Promise<ExternalPurchaseNoticeResultIOS>> presentExternalPurchaseNoticeSheetIOS() override {
|
|
485
|
+
auto __result = _swiftPart.presentExternalPurchaseNoticeSheetIOS();
|
|
486
|
+
if (__result.hasError()) [[unlikely]] {
|
|
487
|
+
std::rethrow_exception(__result.error());
|
|
488
|
+
}
|
|
489
|
+
auto __value = std::move(__result.value());
|
|
490
|
+
return __value;
|
|
491
|
+
}
|
|
492
|
+
inline std::shared_ptr<Promise<ExternalPurchaseLinkResultIOS>> presentExternalPurchaseLinkIOS(const std::string& url) override {
|
|
493
|
+
auto __result = _swiftPart.presentExternalPurchaseLinkIOS(url);
|
|
494
|
+
if (__result.hasError()) [[unlikely]] {
|
|
495
|
+
std::rethrow_exception(__result.error());
|
|
496
|
+
}
|
|
497
|
+
auto __value = std::move(__result.value());
|
|
498
|
+
return __value;
|
|
499
|
+
}
|
|
419
500
|
|
|
420
501
|
private:
|
|
421
502
|
NitroIap::HybridRnIapSpec_cxx _swiftPart;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AlternativeBillingModeAndroid.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 `AlternativeBillingModeAndroid`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias AlternativeBillingModeAndroid = margelo.nitro.iap.AlternativeBillingModeAndroid
|
|
12
|
+
|
|
13
|
+
public extension AlternativeBillingModeAndroid {
|
|
14
|
+
/**
|
|
15
|
+
* Get a AlternativeBillingModeAndroid 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 "none":
|
|
21
|
+
self = .none
|
|
22
|
+
case "user-choice":
|
|
23
|
+
self = .userChoice
|
|
24
|
+
case "alternative-only":
|
|
25
|
+
self = .alternativeOnly
|
|
26
|
+
default:
|
|
27
|
+
return nil
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get the String value this AlternativeBillingModeAndroid represents.
|
|
33
|
+
*/
|
|
34
|
+
var stringValue: String {
|
|
35
|
+
switch self {
|
|
36
|
+
case .none:
|
|
37
|
+
return "none"
|
|
38
|
+
case .userChoice:
|
|
39
|
+
return "user-choice"
|
|
40
|
+
case .alternativeOnly:
|
|
41
|
+
return "alternative-only"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ExternalPurchaseLinkResultIOS.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 `ExternalPurchaseLinkResultIOS`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias ExternalPurchaseLinkResultIOS = margelo.nitro.iap.ExternalPurchaseLinkResultIOS
|
|
14
|
+
|
|
15
|
+
public extension ExternalPurchaseLinkResultIOS {
|
|
16
|
+
private typealias bridge = margelo.nitro.iap.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `ExternalPurchaseLinkResultIOS`.
|
|
20
|
+
*/
|
|
21
|
+
init(error: String?, success: Bool) {
|
|
22
|
+
self.init({ () -> bridge.std__optional_std__string_ in
|
|
23
|
+
if let __unwrappedValue = error {
|
|
24
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), success)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var error: String? {
|
|
32
|
+
@inline(__always)
|
|
33
|
+
get {
|
|
34
|
+
return { () -> String? in
|
|
35
|
+
if bridge.has_value_std__optional_std__string_(self.__error) {
|
|
36
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__error)
|
|
37
|
+
return String(__unwrapped)
|
|
38
|
+
} else {
|
|
39
|
+
return nil
|
|
40
|
+
}
|
|
41
|
+
}()
|
|
42
|
+
}
|
|
43
|
+
@inline(__always)
|
|
44
|
+
set {
|
|
45
|
+
self.__error = { () -> bridge.std__optional_std__string_ in
|
|
46
|
+
if let __unwrappedValue = newValue {
|
|
47
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
48
|
+
} else {
|
|
49
|
+
return .init()
|
|
50
|
+
}
|
|
51
|
+
}()
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
var success: Bool {
|
|
56
|
+
@inline(__always)
|
|
57
|
+
get {
|
|
58
|
+
return self.__success
|
|
59
|
+
}
|
|
60
|
+
@inline(__always)
|
|
61
|
+
set {
|
|
62
|
+
self.__success = newValue
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ExternalPurchaseNoticeAction.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 `ExternalPurchaseNoticeAction`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias ExternalPurchaseNoticeAction = margelo.nitro.iap.ExternalPurchaseNoticeAction
|
|
12
|
+
|
|
13
|
+
public extension ExternalPurchaseNoticeAction {
|
|
14
|
+
/**
|
|
15
|
+
* Get a ExternalPurchaseNoticeAction 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 "continue":
|
|
21
|
+
self = .continue
|
|
22
|
+
case "dismissed":
|
|
23
|
+
self = .dismissed
|
|
24
|
+
default:
|
|
25
|
+
return nil
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get the String value this ExternalPurchaseNoticeAction represents.
|
|
31
|
+
*/
|
|
32
|
+
var stringValue: String {
|
|
33
|
+
switch self {
|
|
34
|
+
case .continue:
|
|
35
|
+
return "continue"
|
|
36
|
+
case .dismissed:
|
|
37
|
+
return "dismissed"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ExternalPurchaseNoticeResultIOS.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 `ExternalPurchaseNoticeResultIOS`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias ExternalPurchaseNoticeResultIOS = margelo.nitro.iap.ExternalPurchaseNoticeResultIOS
|
|
14
|
+
|
|
15
|
+
public extension ExternalPurchaseNoticeResultIOS {
|
|
16
|
+
private typealias bridge = margelo.nitro.iap.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `ExternalPurchaseNoticeResultIOS`.
|
|
20
|
+
*/
|
|
21
|
+
init(error: String?, result: ExternalPurchaseNoticeAction) {
|
|
22
|
+
self.init({ () -> bridge.std__optional_std__string_ in
|
|
23
|
+
if let __unwrappedValue = error {
|
|
24
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), result)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var error: String? {
|
|
32
|
+
@inline(__always)
|
|
33
|
+
get {
|
|
34
|
+
return { () -> String? in
|
|
35
|
+
if bridge.has_value_std__optional_std__string_(self.__error) {
|
|
36
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__error)
|
|
37
|
+
return String(__unwrapped)
|
|
38
|
+
} else {
|
|
39
|
+
return nil
|
|
40
|
+
}
|
|
41
|
+
}()
|
|
42
|
+
}
|
|
43
|
+
@inline(__always)
|
|
44
|
+
set {
|
|
45
|
+
self.__error = { () -> bridge.std__optional_std__string_ in
|
|
46
|
+
if let __unwrappedValue = newValue {
|
|
47
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
48
|
+
} else {
|
|
49
|
+
return .init()
|
|
50
|
+
}
|
|
51
|
+
}()
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
var result: ExternalPurchaseNoticeAction {
|
|
56
|
+
@inline(__always)
|
|
57
|
+
get {
|
|
58
|
+
return self.__result
|
|
59
|
+
}
|
|
60
|
+
@inline(__always)
|
|
61
|
+
set {
|
|
62
|
+
self.__result = newValue
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|