react-native-iap 14.4.46 → 14.5.0
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/NitroIap.podspec +2 -2
- package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +134 -4
- package/ios/HybridRnIap.swift +73 -2
- package/ios/RnIapHelper.swift +8 -0
- package/lib/module/hooks/useIAP.js +9 -1
- package/lib/module/hooks/useIAP.js.map +1 -1
- package/lib/module/index.js +69 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js +5 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/errorMapping.js +32 -6
- package/lib/module/utils/errorMapping.js.map +1 -1
- package/lib/module/utils/type-bridge.js +19 -0
- package/lib/module/utils/type-bridge.js.map +1 -1
- package/lib/typescript/src/hooks/useIAP.d.ts +5 -1
- package/lib/typescript/src/hooks/useIAP.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +34 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/RnIap.nitro.d.ts +86 -26
- package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +145 -55
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/errorMapping.d.ts.map +1 -1
- package/lib/typescript/src/utils/type-bridge.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JFunc_void_NitroPurchase.hpp +2 -0
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +80 -0
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.hpp +2 -0
- package/nitrogen/generated/android/c++/JIapStore.hpp +65 -0
- package/nitrogen/generated/android/c++/JIapkitPurchaseState.hpp +80 -0
- package/nitrogen/generated/android/c++/JNitroPurchase.hpp +7 -1
- package/nitrogen/generated/android/c++/JNitroPurchaseRequest.hpp +11 -3
- package/nitrogen/generated/android/c++/JNitroReceiptValidationResultIOS.hpp +2 -0
- package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithIapkitAppleProps.hpp +57 -0
- package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithIapkitGoogleProps.hpp +57 -0
- package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithIapkitProps.hpp +70 -0
- package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithIapkitResult.hpp +68 -0
- package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithProviderError.hpp +62 -0
- package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithProviderProps.hpp +70 -0
- package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithProviderResult.hpp +94 -0
- package/nitrogen/generated/android/c++/JPurchase.hpp +2 -0
- package/nitrogen/generated/android/c++/JPurchaseAndroid.hpp +7 -1
- package/nitrogen/generated/android/c++/JPurchaseIOS.hpp +7 -1
- package/nitrogen/generated/android/c++/JPurchaseVerificationProvider.hpp +59 -0
- package/nitrogen/generated/android/c++/JRequestPurchaseResult.hpp +2 -0
- package/nitrogen/generated/android/c++/JVariant_NitroReceiptValidationResultIOS_NitroReceiptValidationResultAndroid.hpp +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +8 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/IapStore.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/IapkitPurchaseState.kt +28 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchase.kt +5 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchaseRequest.kt +9 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithIapkitAppleProps.kt +36 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithIapkitGoogleProps.kt +36 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithIapkitProps.kt +42 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithIapkitResult.kt +42 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithProviderError.kt +39 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithProviderProps.kt +39 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithProviderResult.kt +42 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseAndroid.kt +5 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseIOS.kt +5 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseVerificationProvider.kt +21 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.cpp +8 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +156 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +30 -0
- package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +46 -0
- package/nitrogen/generated/ios/swift/Func_void_NitroVerifyPurchaseWithProviderResult.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +2 -0
- package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +45 -0
- package/nitrogen/generated/ios/swift/IapStore.swift +48 -0
- package/nitrogen/generated/ios/swift/IapkitPurchaseState.swift +68 -0
- package/nitrogen/generated/ios/swift/NitroPurchase.swift +13 -2
- package/nitrogen/generated/ios/swift/NitroPurchaseRequest.swift +47 -1
- package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithIapkitAppleProps.swift +35 -0
- package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithIapkitGoogleProps.swift +35 -0
- package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithIapkitProps.swift +100 -0
- package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithIapkitResult.swift +57 -0
- package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithProviderError.swift +65 -0
- package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithProviderProps.swift +58 -0
- package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithProviderResult.swift +100 -0
- package/nitrogen/generated/ios/swift/PurchaseAndroid.swift +13 -2
- package/nitrogen/generated/ios/swift/PurchaseIOS.swift +13 -2
- package/nitrogen/generated/ios/swift/PurchaseVerificationProvider.swift +40 -0
- package/nitrogen/generated/shared/c++/HybridRnIapSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridRnIapSpec.hpp +8 -0
- package/nitrogen/generated/shared/c++/IapStore.hpp +84 -0
- package/nitrogen/generated/shared/c++/IapkitPurchaseState.hpp +104 -0
- package/nitrogen/generated/shared/c++/NitroPurchase.hpp +8 -1
- package/nitrogen/generated/shared/c++/NitroPurchaseRequest.hpp +10 -2
- package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithIapkitAppleProps.hpp +75 -0
- package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithIapkitGoogleProps.hpp +75 -0
- package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithIapkitProps.hpp +89 -0
- package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithIapkitResult.hpp +87 -0
- package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithProviderError.hpp +80 -0
- package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithProviderProps.hpp +84 -0
- package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithProviderResult.hpp +92 -0
- package/nitrogen/generated/shared/c++/PurchaseAndroid.hpp +8 -1
- package/nitrogen/generated/shared/c++/PurchaseIOS.hpp +8 -1
- package/nitrogen/generated/shared/c++/PurchaseVerificationProvider.hpp +76 -0
- package/openiap-versions.json +3 -3
- package/package.json +1 -1
- package/src/hooks/useIAP.ts +32 -0
- package/src/index.ts +77 -5
- package/src/specs/RnIap.nitro.ts +117 -28
- package/src/types.ts +163 -61
- package/src/utils/errorMapping.ts +32 -4
- package/src/utils/type-bridge.ts +22 -0
|
@@ -22,6 +22,10 @@ namespace margelo::nitro::iap { struct ExternalPurchaseNoticeResultIOS; }
|
|
|
22
22
|
namespace margelo::nitro::iap { class HybridRnIapSpec; }
|
|
23
23
|
// Forward declaration of `IapPlatform` to properly resolve imports.
|
|
24
24
|
namespace margelo::nitro::iap { enum class IapPlatform; }
|
|
25
|
+
// Forward declaration of `IapStore` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::iap { enum class IapStore; }
|
|
27
|
+
// Forward declaration of `IapkitPurchaseState` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::iap { enum class IapkitPurchaseState; }
|
|
25
29
|
// Forward declaration of `InitConnectionConfig` to properly resolve imports.
|
|
26
30
|
namespace margelo::nitro::iap { struct InitConnectionConfig; }
|
|
27
31
|
// Forward declaration of `NitroActiveSubscription` to properly resolve imports.
|
|
@@ -70,6 +74,20 @@ namespace margelo::nitro::iap { struct NitroRequestPurchaseIos; }
|
|
|
70
74
|
namespace margelo::nitro::iap { struct NitroSubscriptionRenewalInfo; }
|
|
71
75
|
// Forward declaration of `NitroSubscriptionStatus` to properly resolve imports.
|
|
72
76
|
namespace margelo::nitro::iap { struct NitroSubscriptionStatus; }
|
|
77
|
+
// Forward declaration of `NitroVerifyPurchaseWithIapkitAppleProps` to properly resolve imports.
|
|
78
|
+
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitAppleProps; }
|
|
79
|
+
// Forward declaration of `NitroVerifyPurchaseWithIapkitGoogleProps` to properly resolve imports.
|
|
80
|
+
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitGoogleProps; }
|
|
81
|
+
// Forward declaration of `NitroVerifyPurchaseWithIapkitProps` to properly resolve imports.
|
|
82
|
+
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitProps; }
|
|
83
|
+
// Forward declaration of `NitroVerifyPurchaseWithIapkitResult` to properly resolve imports.
|
|
84
|
+
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitResult; }
|
|
85
|
+
// Forward declaration of `NitroVerifyPurchaseWithProviderError` to properly resolve imports.
|
|
86
|
+
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithProviderError; }
|
|
87
|
+
// Forward declaration of `NitroVerifyPurchaseWithProviderProps` to properly resolve imports.
|
|
88
|
+
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithProviderProps; }
|
|
89
|
+
// Forward declaration of `NitroVerifyPurchaseWithProviderResult` to properly resolve imports.
|
|
90
|
+
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithProviderResult; }
|
|
73
91
|
// Forward declaration of `PaymentModeIOS` to properly resolve imports.
|
|
74
92
|
namespace margelo::nitro::iap { enum class PaymentModeIOS; }
|
|
75
93
|
// Forward declaration of `PurchaseAndroid` to properly resolve imports.
|
|
@@ -80,6 +98,8 @@ namespace margelo::nitro::iap { struct PurchaseIOS; }
|
|
|
80
98
|
namespace margelo::nitro::iap { struct PurchaseOfferIOS; }
|
|
81
99
|
// Forward declaration of `PurchaseState` to properly resolve imports.
|
|
82
100
|
namespace margelo::nitro::iap { enum class PurchaseState; }
|
|
101
|
+
// Forward declaration of `PurchaseVerificationProvider` to properly resolve imports.
|
|
102
|
+
namespace margelo::nitro::iap { enum class PurchaseVerificationProvider; }
|
|
83
103
|
// Forward declaration of `RenewalInfoIOS` to properly resolve imports.
|
|
84
104
|
namespace margelo::nitro::iap { struct RenewalInfoIOS; }
|
|
85
105
|
// Forward declaration of `UserChoiceBillingDetails` to properly resolve imports.
|
|
@@ -93,6 +113,8 @@ namespace margelo::nitro::iap { struct UserChoiceBillingDetails; }
|
|
|
93
113
|
#include "ExternalPurchaseNoticeResultIOS.hpp"
|
|
94
114
|
#include "HybridRnIapSpec.hpp"
|
|
95
115
|
#include "IapPlatform.hpp"
|
|
116
|
+
#include "IapStore.hpp"
|
|
117
|
+
#include "IapkitPurchaseState.hpp"
|
|
96
118
|
#include "InitConnectionConfig.hpp"
|
|
97
119
|
#include "NitroActiveSubscription.hpp"
|
|
98
120
|
#include "NitroAvailablePurchasesAndroidOptions.hpp"
|
|
@@ -117,11 +139,19 @@ namespace margelo::nitro::iap { struct UserChoiceBillingDetails; }
|
|
|
117
139
|
#include "NitroRequestPurchaseIos.hpp"
|
|
118
140
|
#include "NitroSubscriptionRenewalInfo.hpp"
|
|
119
141
|
#include "NitroSubscriptionStatus.hpp"
|
|
142
|
+
#include "NitroVerifyPurchaseWithIapkitAppleProps.hpp"
|
|
143
|
+
#include "NitroVerifyPurchaseWithIapkitGoogleProps.hpp"
|
|
144
|
+
#include "NitroVerifyPurchaseWithIapkitProps.hpp"
|
|
145
|
+
#include "NitroVerifyPurchaseWithIapkitResult.hpp"
|
|
146
|
+
#include "NitroVerifyPurchaseWithProviderError.hpp"
|
|
147
|
+
#include "NitroVerifyPurchaseWithProviderProps.hpp"
|
|
148
|
+
#include "NitroVerifyPurchaseWithProviderResult.hpp"
|
|
120
149
|
#include "PaymentModeIOS.hpp"
|
|
121
150
|
#include "PurchaseAndroid.hpp"
|
|
122
151
|
#include "PurchaseIOS.hpp"
|
|
123
152
|
#include "PurchaseOfferIOS.hpp"
|
|
124
153
|
#include "PurchaseState.hpp"
|
|
154
|
+
#include "PurchaseVerificationProvider.hpp"
|
|
125
155
|
#include "RenewalInfoIOS.hpp"
|
|
126
156
|
#include "UserChoiceBillingDetails.hpp"
|
|
127
157
|
#include <NitroModules/Promise.hpp>
|
|
@@ -30,6 +30,8 @@ namespace margelo::nitro::iap { struct PurchaseAndroid; }
|
|
|
30
30
|
namespace margelo::nitro::iap { struct PurchaseIOS; }
|
|
31
31
|
// Forward declaration of `PurchaseState` to properly resolve imports.
|
|
32
32
|
namespace margelo::nitro::iap { enum class PurchaseState; }
|
|
33
|
+
// Forward declaration of `IapStore` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::iap { enum class IapStore; }
|
|
33
35
|
// Forward declaration of `PurchaseOfferIOS` to properly resolve imports.
|
|
34
36
|
namespace margelo::nitro::iap { struct PurchaseOfferIOS; }
|
|
35
37
|
// Forward declaration of `RenewalInfoIOS` to properly resolve imports.
|
|
@@ -76,6 +78,24 @@ namespace margelo::nitro::iap { struct NitroReceiptValidationResultAndroid; }
|
|
|
76
78
|
namespace margelo::nitro::iap { struct NitroReceiptValidationParams; }
|
|
77
79
|
// Forward declaration of `NitroReceiptValidationAndroidOptions` to properly resolve imports.
|
|
78
80
|
namespace margelo::nitro::iap { struct NitroReceiptValidationAndroidOptions; }
|
|
81
|
+
// Forward declaration of `NitroVerifyPurchaseWithProviderResult` to properly resolve imports.
|
|
82
|
+
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithProviderResult; }
|
|
83
|
+
// Forward declaration of `NitroVerifyPurchaseWithIapkitResult` to properly resolve imports.
|
|
84
|
+
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitResult; }
|
|
85
|
+
// Forward declaration of `IapkitPurchaseState` to properly resolve imports.
|
|
86
|
+
namespace margelo::nitro::iap { enum class IapkitPurchaseState; }
|
|
87
|
+
// Forward declaration of `NitroVerifyPurchaseWithProviderError` to properly resolve imports.
|
|
88
|
+
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithProviderError; }
|
|
89
|
+
// Forward declaration of `PurchaseVerificationProvider` to properly resolve imports.
|
|
90
|
+
namespace margelo::nitro::iap { enum class PurchaseVerificationProvider; }
|
|
91
|
+
// Forward declaration of `NitroVerifyPurchaseWithProviderProps` to properly resolve imports.
|
|
92
|
+
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithProviderProps; }
|
|
93
|
+
// Forward declaration of `NitroVerifyPurchaseWithIapkitProps` to properly resolve imports.
|
|
94
|
+
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitProps; }
|
|
95
|
+
// Forward declaration of `NitroVerifyPurchaseWithIapkitAppleProps` to properly resolve imports.
|
|
96
|
+
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitAppleProps; }
|
|
97
|
+
// Forward declaration of `NitroVerifyPurchaseWithIapkitGoogleProps` to properly resolve imports.
|
|
98
|
+
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitGoogleProps; }
|
|
79
99
|
// Forward declaration of `NitroDeepLinkOptionsAndroid` to properly resolve imports.
|
|
80
100
|
namespace margelo::nitro::iap { struct NitroDeepLinkOptionsAndroid; }
|
|
81
101
|
// Forward declaration of `UserChoiceBillingDetails` to properly resolve imports.
|
|
@@ -101,6 +121,7 @@ namespace margelo::nitro::iap { struct ExternalPurchaseLinkResultIOS; }
|
|
|
101
121
|
#include "PurchaseIOS.hpp"
|
|
102
122
|
#include <variant>
|
|
103
123
|
#include "PurchaseState.hpp"
|
|
124
|
+
#include "IapStore.hpp"
|
|
104
125
|
#include "PurchaseOfferIOS.hpp"
|
|
105
126
|
#include "RenewalInfoIOS.hpp"
|
|
106
127
|
#include "NitroPurchaseRequest.hpp"
|
|
@@ -126,6 +147,15 @@ namespace margelo::nitro::iap { struct ExternalPurchaseLinkResultIOS; }
|
|
|
126
147
|
#include "NitroReceiptValidationResultAndroid.hpp"
|
|
127
148
|
#include "NitroReceiptValidationParams.hpp"
|
|
128
149
|
#include "NitroReceiptValidationAndroidOptions.hpp"
|
|
150
|
+
#include "NitroVerifyPurchaseWithProviderResult.hpp"
|
|
151
|
+
#include "NitroVerifyPurchaseWithIapkitResult.hpp"
|
|
152
|
+
#include "IapkitPurchaseState.hpp"
|
|
153
|
+
#include "NitroVerifyPurchaseWithProviderError.hpp"
|
|
154
|
+
#include "PurchaseVerificationProvider.hpp"
|
|
155
|
+
#include "NitroVerifyPurchaseWithProviderProps.hpp"
|
|
156
|
+
#include "NitroVerifyPurchaseWithIapkitProps.hpp"
|
|
157
|
+
#include "NitroVerifyPurchaseWithIapkitAppleProps.hpp"
|
|
158
|
+
#include "NitroVerifyPurchaseWithIapkitGoogleProps.hpp"
|
|
129
159
|
#include "NitroDeepLinkOptionsAndroid.hpp"
|
|
130
160
|
#include "UserChoiceBillingDetails.hpp"
|
|
131
161
|
#include "ExternalPurchaseNoticeResultIOS.hpp"
|
|
@@ -221,6 +251,14 @@ namespace margelo::nitro::iap {
|
|
|
221
251
|
auto __value = std::move(__result.value());
|
|
222
252
|
return __value;
|
|
223
253
|
}
|
|
254
|
+
inline std::shared_ptr<Promise<bool>> hasActiveSubscriptions(const std::optional<std::vector<std::string>>& subscriptionIds) override {
|
|
255
|
+
auto __result = _swiftPart.hasActiveSubscriptions(subscriptionIds);
|
|
256
|
+
if (__result.hasError()) [[unlikely]] {
|
|
257
|
+
std::rethrow_exception(__result.error());
|
|
258
|
+
}
|
|
259
|
+
auto __value = std::move(__result.value());
|
|
260
|
+
return __value;
|
|
261
|
+
}
|
|
224
262
|
inline std::shared_ptr<Promise<std::variant<bool, NitroPurchaseResult>>> finishTransaction(const NitroFinishTransactionParams& params) override {
|
|
225
263
|
auto __result = _swiftPart.finishTransaction(std::forward<decltype(params)>(params));
|
|
226
264
|
if (__result.hasError()) [[unlikely]] {
|
|
@@ -441,6 +479,14 @@ namespace margelo::nitro::iap {
|
|
|
441
479
|
auto __value = std::move(__result.value());
|
|
442
480
|
return __value;
|
|
443
481
|
}
|
|
482
|
+
inline std::shared_ptr<Promise<NitroVerifyPurchaseWithProviderResult>> verifyPurchaseWithProvider(const NitroVerifyPurchaseWithProviderProps& params) override {
|
|
483
|
+
auto __result = _swiftPart.verifyPurchaseWithProvider(std::forward<decltype(params)>(params));
|
|
484
|
+
if (__result.hasError()) [[unlikely]] {
|
|
485
|
+
std::rethrow_exception(__result.error());
|
|
486
|
+
}
|
|
487
|
+
auto __value = std::move(__result.value());
|
|
488
|
+
return __value;
|
|
489
|
+
}
|
|
444
490
|
inline std::shared_ptr<Promise<std::string>> getStorefront() override {
|
|
445
491
|
auto __result = _swiftPart.getStorefront();
|
|
446
492
|
if (__result.hasError()) [[unlikely]] {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_NitroVerifyPurchaseWithProviderResult.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: NitroVerifyPurchaseWithProviderResult) -> 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_NitroVerifyPurchaseWithProviderResult {
|
|
16
|
+
public typealias bridge = margelo.nitro.iap.bridge.swift
|
|
17
|
+
|
|
18
|
+
private let closure: (_ value: NitroVerifyPurchaseWithProviderResult) -> Void
|
|
19
|
+
|
|
20
|
+
public init(_ closure: @escaping (_ value: NitroVerifyPurchaseWithProviderResult) -> Void) {
|
|
21
|
+
self.closure = closure
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@inline(__always)
|
|
25
|
+
public func call(value: NitroVerifyPurchaseWithProviderResult) -> 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_NitroVerifyPurchaseWithProviderResult`.
|
|
40
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_NitroVerifyPurchaseWithProviderResult>`.
|
|
41
|
+
* This removes one strong reference from the object!
|
|
42
|
+
*/
|
|
43
|
+
@inline(__always)
|
|
44
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_NitroVerifyPurchaseWithProviderResult {
|
|
45
|
+
return Unmanaged<Func_void_NitroVerifyPurchaseWithProviderResult>.fromOpaque(pointer).takeRetainedValue()
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -21,6 +21,7 @@ public protocol HybridRnIapSpec_protocol: HybridObject {
|
|
|
21
21
|
func requestPurchase(request: NitroPurchaseRequest) throws -> Promise<RequestPurchaseResult?>
|
|
22
22
|
func getAvailablePurchases(options: NitroAvailablePurchasesOptions?) throws -> Promise<[NitroPurchase]>
|
|
23
23
|
func getActiveSubscriptions(subscriptionIds: [String]?) throws -> Promise<[NitroActiveSubscription]>
|
|
24
|
+
func hasActiveSubscriptions(subscriptionIds: [String]?) throws -> Promise<Bool>
|
|
24
25
|
func finishTransaction(params: NitroFinishTransactionParams) throws -> Promise<Variant_Bool_NitroPurchaseResult>
|
|
25
26
|
func addPurchaseUpdatedListener(listener: @escaping (_ purchase: NitroPurchase) -> Void) throws -> Void
|
|
26
27
|
func addPurchaseErrorListener(listener: @escaping (_ error: NitroPurchaseResult) -> Void) throws -> Void
|
|
@@ -50,6 +51,7 @@ public protocol HybridRnIapSpec_protocol: HybridObject {
|
|
|
50
51
|
func isTransactionVerifiedIOS(sku: String) throws -> Promise<Bool>
|
|
51
52
|
func getTransactionJwsIOS(sku: String) throws -> Promise<String?>
|
|
52
53
|
func validateReceipt(params: NitroReceiptValidationParams) throws -> Promise<Variant_NitroReceiptValidationResultIOS_NitroReceiptValidationResultAndroid>
|
|
54
|
+
func verifyPurchaseWithProvider(params: NitroVerifyPurchaseWithProviderProps) throws -> Promise<NitroVerifyPurchaseWithProviderResult>
|
|
53
55
|
func getStorefront() throws -> Promise<String>
|
|
54
56
|
func deepLinkToSubscriptionsAndroid(options: NitroDeepLinkOptionsAndroid) throws -> Promise<Void>
|
|
55
57
|
func checkAlternativeBillingAvailabilityAndroid() throws -> Promise<Bool>
|
|
@@ -277,6 +277,32 @@ open class HybridRnIapSpec_cxx {
|
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
+
@inline(__always)
|
|
281
|
+
public final func hasActiveSubscriptions(subscriptionIds: bridge.std__optional_std__vector_std__string__) -> bridge.Result_std__shared_ptr_Promise_bool___ {
|
|
282
|
+
do {
|
|
283
|
+
let __result = try self.__implementation.hasActiveSubscriptions(subscriptionIds: { () -> [String]? in
|
|
284
|
+
if bridge.has_value_std__optional_std__vector_std__string__(subscriptionIds) {
|
|
285
|
+
let __unwrapped = bridge.get_std__optional_std__vector_std__string__(subscriptionIds)
|
|
286
|
+
return __unwrapped.map({ __item in String(__item) })
|
|
287
|
+
} else {
|
|
288
|
+
return nil
|
|
289
|
+
}
|
|
290
|
+
}())
|
|
291
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in
|
|
292
|
+
let __promise = bridge.create_std__shared_ptr_Promise_bool__()
|
|
293
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise)
|
|
294
|
+
__result
|
|
295
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
296
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
297
|
+
return __promise
|
|
298
|
+
}()
|
|
299
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp)
|
|
300
|
+
} catch (let __error) {
|
|
301
|
+
let __exceptionPtr = __error.toCpp()
|
|
302
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr)
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
280
306
|
@inline(__always)
|
|
281
307
|
public final func finishTransaction(params: NitroFinishTransactionParams) -> bridge.Result_std__shared_ptr_Promise_std__variant_bool__NitroPurchaseResult____ {
|
|
282
308
|
do {
|
|
@@ -890,6 +916,25 @@ open class HybridRnIapSpec_cxx {
|
|
|
890
916
|
}
|
|
891
917
|
}
|
|
892
918
|
|
|
919
|
+
@inline(__always)
|
|
920
|
+
public final func verifyPurchaseWithProvider(params: NitroVerifyPurchaseWithProviderProps) -> bridge.Result_std__shared_ptr_Promise_NitroVerifyPurchaseWithProviderResult___ {
|
|
921
|
+
do {
|
|
922
|
+
let __result = try self.__implementation.verifyPurchaseWithProvider(params: params)
|
|
923
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_NitroVerifyPurchaseWithProviderResult__ in
|
|
924
|
+
let __promise = bridge.create_std__shared_ptr_Promise_NitroVerifyPurchaseWithProviderResult__()
|
|
925
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_NitroVerifyPurchaseWithProviderResult__(__promise)
|
|
926
|
+
__result
|
|
927
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
928
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
929
|
+
return __promise
|
|
930
|
+
}()
|
|
931
|
+
return bridge.create_Result_std__shared_ptr_Promise_NitroVerifyPurchaseWithProviderResult___(__resultCpp)
|
|
932
|
+
} catch (let __error) {
|
|
933
|
+
let __exceptionPtr = __error.toCpp()
|
|
934
|
+
return bridge.create_Result_std__shared_ptr_Promise_NitroVerifyPurchaseWithProviderResult___(__exceptionPtr)
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
|
|
893
938
|
@inline(__always)
|
|
894
939
|
public final func getStorefront() -> bridge.Result_std__shared_ptr_Promise_std__string___ {
|
|
895
940
|
do {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// IapStore.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 `IapStore`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias IapStore = margelo.nitro.iap.IapStore
|
|
12
|
+
|
|
13
|
+
public extension IapStore {
|
|
14
|
+
/**
|
|
15
|
+
* Get a IapStore 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 "unknown":
|
|
21
|
+
self = .unknown
|
|
22
|
+
case "apple":
|
|
23
|
+
self = .apple
|
|
24
|
+
case "google":
|
|
25
|
+
self = .google
|
|
26
|
+
case "horizon":
|
|
27
|
+
self = .horizon
|
|
28
|
+
default:
|
|
29
|
+
return nil
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Get the String value this IapStore represents.
|
|
35
|
+
*/
|
|
36
|
+
var stringValue: String {
|
|
37
|
+
switch self {
|
|
38
|
+
case .unknown:
|
|
39
|
+
return "unknown"
|
|
40
|
+
case .apple:
|
|
41
|
+
return "apple"
|
|
42
|
+
case .google:
|
|
43
|
+
return "google"
|
|
44
|
+
case .horizon:
|
|
45
|
+
return "horizon"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// IapkitPurchaseState.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 `IapkitPurchaseState`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias IapkitPurchaseState = margelo.nitro.iap.IapkitPurchaseState
|
|
12
|
+
|
|
13
|
+
public extension IapkitPurchaseState {
|
|
14
|
+
/**
|
|
15
|
+
* Get a IapkitPurchaseState 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 "pending":
|
|
21
|
+
self = .pending
|
|
22
|
+
case "unknown":
|
|
23
|
+
self = .unknown
|
|
24
|
+
case "entitled":
|
|
25
|
+
self = .entitled
|
|
26
|
+
case "pending-acknowledgment":
|
|
27
|
+
self = .pendingAcknowledgment
|
|
28
|
+
case "canceled":
|
|
29
|
+
self = .canceled
|
|
30
|
+
case "expired":
|
|
31
|
+
self = .expired
|
|
32
|
+
case "ready-to-consume":
|
|
33
|
+
self = .readyToConsume
|
|
34
|
+
case "consumed":
|
|
35
|
+
self = .consumed
|
|
36
|
+
case "inauthentic":
|
|
37
|
+
self = .inauthentic
|
|
38
|
+
default:
|
|
39
|
+
return nil
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Get the String value this IapkitPurchaseState represents.
|
|
45
|
+
*/
|
|
46
|
+
var stringValue: String {
|
|
47
|
+
switch self {
|
|
48
|
+
case .pending:
|
|
49
|
+
return "pending"
|
|
50
|
+
case .unknown:
|
|
51
|
+
return "unknown"
|
|
52
|
+
case .entitled:
|
|
53
|
+
return "entitled"
|
|
54
|
+
case .pendingAcknowledgment:
|
|
55
|
+
return "pending-acknowledgment"
|
|
56
|
+
case .canceled:
|
|
57
|
+
return "canceled"
|
|
58
|
+
case .expired:
|
|
59
|
+
return "expired"
|
|
60
|
+
case .readyToConsume:
|
|
61
|
+
return "ready-to-consume"
|
|
62
|
+
case .consumed:
|
|
63
|
+
return "consumed"
|
|
64
|
+
case .inauthentic:
|
|
65
|
+
return "inauthentic"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -18,14 +18,14 @@ 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?, 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?, renewalInfoIOS: NitroRenewalInfoIOS?, purchaseTokenAndroid: String?, dataAndroid: String?, signatureAndroid: String?, autoRenewingAndroid: Bool?, purchaseStateAndroid: Double?, isAcknowledgedAndroid: Bool?, packageNameAndroid: String?, obfuscatedAccountIdAndroid: String?, obfuscatedProfileIdAndroid: String?, developerPayloadAndroid: String?) {
|
|
21
|
+
init(id: String, productId: String, transactionDate: Double, purchaseToken: String?, platform: IapPlatform, store: IapStore, 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?, renewalInfoIOS: NitroRenewalInfoIOS?, 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))
|
|
25
25
|
} else {
|
|
26
26
|
return .init()
|
|
27
27
|
}
|
|
28
|
-
}(), platform, quantity, purchaseState, isAutoRenewing, { () -> bridge.std__optional_double_ in
|
|
28
|
+
}(), platform, store, quantity, purchaseState, isAutoRenewing, { () -> bridge.std__optional_double_ in
|
|
29
29
|
if let __unwrappedValue = quantityIOS {
|
|
30
30
|
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
31
31
|
} else {
|
|
@@ -288,6 +288,17 @@ public extension NitroPurchase {
|
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
+
var store: IapStore {
|
|
292
|
+
@inline(__always)
|
|
293
|
+
get {
|
|
294
|
+
return self.__store
|
|
295
|
+
}
|
|
296
|
+
@inline(__always)
|
|
297
|
+
set {
|
|
298
|
+
self.__store = newValue
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
291
302
|
var quantity: Double {
|
|
292
303
|
@inline(__always)
|
|
293
304
|
get {
|
|
@@ -18,7 +18,7 @@ public extension NitroPurchaseRequest {
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `NitroPurchaseRequest`.
|
|
20
20
|
*/
|
|
21
|
-
init(ios: NitroRequestPurchaseIos?, android: NitroRequestPurchaseAndroid?) {
|
|
21
|
+
init(ios: NitroRequestPurchaseIos?, android: NitroRequestPurchaseAndroid?, apple: NitroRequestPurchaseIos?, google: NitroRequestPurchaseAndroid?) {
|
|
22
22
|
self.init({ () -> bridge.std__optional_NitroRequestPurchaseIos_ in
|
|
23
23
|
if let __unwrappedValue = ios {
|
|
24
24
|
return bridge.create_std__optional_NitroRequestPurchaseIos_(__unwrappedValue)
|
|
@@ -31,6 +31,18 @@ public extension NitroPurchaseRequest {
|
|
|
31
31
|
} else {
|
|
32
32
|
return .init()
|
|
33
33
|
}
|
|
34
|
+
}(), { () -> bridge.std__optional_NitroRequestPurchaseIos_ in
|
|
35
|
+
if let __unwrappedValue = apple {
|
|
36
|
+
return bridge.create_std__optional_NitroRequestPurchaseIos_(__unwrappedValue)
|
|
37
|
+
} else {
|
|
38
|
+
return .init()
|
|
39
|
+
}
|
|
40
|
+
}(), { () -> bridge.std__optional_NitroRequestPurchaseAndroid_ in
|
|
41
|
+
if let __unwrappedValue = google {
|
|
42
|
+
return bridge.create_std__optional_NitroRequestPurchaseAndroid_(__unwrappedValue)
|
|
43
|
+
} else {
|
|
44
|
+
return .init()
|
|
45
|
+
}
|
|
34
46
|
}())
|
|
35
47
|
}
|
|
36
48
|
|
|
@@ -67,4 +79,38 @@ public extension NitroPurchaseRequest {
|
|
|
67
79
|
}()
|
|
68
80
|
}
|
|
69
81
|
}
|
|
82
|
+
|
|
83
|
+
var apple: NitroRequestPurchaseIos? {
|
|
84
|
+
@inline(__always)
|
|
85
|
+
get {
|
|
86
|
+
return self.__apple.value
|
|
87
|
+
}
|
|
88
|
+
@inline(__always)
|
|
89
|
+
set {
|
|
90
|
+
self.__apple = { () -> bridge.std__optional_NitroRequestPurchaseIos_ in
|
|
91
|
+
if let __unwrappedValue = newValue {
|
|
92
|
+
return bridge.create_std__optional_NitroRequestPurchaseIos_(__unwrappedValue)
|
|
93
|
+
} else {
|
|
94
|
+
return .init()
|
|
95
|
+
}
|
|
96
|
+
}()
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
var google: NitroRequestPurchaseAndroid? {
|
|
101
|
+
@inline(__always)
|
|
102
|
+
get {
|
|
103
|
+
return self.__google.value
|
|
104
|
+
}
|
|
105
|
+
@inline(__always)
|
|
106
|
+
set {
|
|
107
|
+
self.__google = { () -> bridge.std__optional_NitroRequestPurchaseAndroid_ in
|
|
108
|
+
if let __unwrappedValue = newValue {
|
|
109
|
+
return bridge.create_std__optional_NitroRequestPurchaseAndroid_(__unwrappedValue)
|
|
110
|
+
} else {
|
|
111
|
+
return .init()
|
|
112
|
+
}
|
|
113
|
+
}()
|
|
114
|
+
}
|
|
115
|
+
}
|
|
70
116
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroVerifyPurchaseWithIapkitAppleProps.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 `NitroVerifyPurchaseWithIapkitAppleProps`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias NitroVerifyPurchaseWithIapkitAppleProps = margelo.nitro.iap.NitroVerifyPurchaseWithIapkitAppleProps
|
|
14
|
+
|
|
15
|
+
public extension NitroVerifyPurchaseWithIapkitAppleProps {
|
|
16
|
+
private typealias bridge = margelo.nitro.iap.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `NitroVerifyPurchaseWithIapkitAppleProps`.
|
|
20
|
+
*/
|
|
21
|
+
init(jws: String) {
|
|
22
|
+
self.init(std.string(jws))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var jws: String {
|
|
26
|
+
@inline(__always)
|
|
27
|
+
get {
|
|
28
|
+
return String(self.__jws)
|
|
29
|
+
}
|
|
30
|
+
@inline(__always)
|
|
31
|
+
set {
|
|
32
|
+
self.__jws = std.string(newValue)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroVerifyPurchaseWithIapkitGoogleProps.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 `NitroVerifyPurchaseWithIapkitGoogleProps`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias NitroVerifyPurchaseWithIapkitGoogleProps = margelo.nitro.iap.NitroVerifyPurchaseWithIapkitGoogleProps
|
|
14
|
+
|
|
15
|
+
public extension NitroVerifyPurchaseWithIapkitGoogleProps {
|
|
16
|
+
private typealias bridge = margelo.nitro.iap.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `NitroVerifyPurchaseWithIapkitGoogleProps`.
|
|
20
|
+
*/
|
|
21
|
+
init(purchaseToken: String) {
|
|
22
|
+
self.init(std.string(purchaseToken))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var purchaseToken: String {
|
|
26
|
+
@inline(__always)
|
|
27
|
+
get {
|
|
28
|
+
return String(self.__purchaseToken)
|
|
29
|
+
}
|
|
30
|
+
@inline(__always)
|
|
31
|
+
set {
|
|
32
|
+
self.__purchaseToken = std.string(newValue)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroVerifyPurchaseWithIapkitProps.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 `NitroVerifyPurchaseWithIapkitProps`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias NitroVerifyPurchaseWithIapkitProps = margelo.nitro.iap.NitroVerifyPurchaseWithIapkitProps
|
|
14
|
+
|
|
15
|
+
public extension NitroVerifyPurchaseWithIapkitProps {
|
|
16
|
+
private typealias bridge = margelo.nitro.iap.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `NitroVerifyPurchaseWithIapkitProps`.
|
|
20
|
+
*/
|
|
21
|
+
init(apiKey: String?, apple: NitroVerifyPurchaseWithIapkitAppleProps?, google: NitroVerifyPurchaseWithIapkitGoogleProps?) {
|
|
22
|
+
self.init({ () -> bridge.std__optional_std__string_ in
|
|
23
|
+
if let __unwrappedValue = apiKey {
|
|
24
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), { () -> bridge.std__optional_NitroVerifyPurchaseWithIapkitAppleProps_ in
|
|
29
|
+
if let __unwrappedValue = apple {
|
|
30
|
+
return bridge.create_std__optional_NitroVerifyPurchaseWithIapkitAppleProps_(__unwrappedValue)
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
34
|
+
}(), { () -> bridge.std__optional_NitroVerifyPurchaseWithIapkitGoogleProps_ in
|
|
35
|
+
if let __unwrappedValue = google {
|
|
36
|
+
return bridge.create_std__optional_NitroVerifyPurchaseWithIapkitGoogleProps_(__unwrappedValue)
|
|
37
|
+
} else {
|
|
38
|
+
return .init()
|
|
39
|
+
}
|
|
40
|
+
}())
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
var apiKey: String? {
|
|
44
|
+
@inline(__always)
|
|
45
|
+
get {
|
|
46
|
+
return { () -> String? in
|
|
47
|
+
if bridge.has_value_std__optional_std__string_(self.__apiKey) {
|
|
48
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__apiKey)
|
|
49
|
+
return String(__unwrapped)
|
|
50
|
+
} else {
|
|
51
|
+
return nil
|
|
52
|
+
}
|
|
53
|
+
}()
|
|
54
|
+
}
|
|
55
|
+
@inline(__always)
|
|
56
|
+
set {
|
|
57
|
+
self.__apiKey = { () -> bridge.std__optional_std__string_ in
|
|
58
|
+
if let __unwrappedValue = newValue {
|
|
59
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
60
|
+
} else {
|
|
61
|
+
return .init()
|
|
62
|
+
}
|
|
63
|
+
}()
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
var apple: NitroVerifyPurchaseWithIapkitAppleProps? {
|
|
68
|
+
@inline(__always)
|
|
69
|
+
get {
|
|
70
|
+
return self.__apple.value
|
|
71
|
+
}
|
|
72
|
+
@inline(__always)
|
|
73
|
+
set {
|
|
74
|
+
self.__apple = { () -> bridge.std__optional_NitroVerifyPurchaseWithIapkitAppleProps_ in
|
|
75
|
+
if let __unwrappedValue = newValue {
|
|
76
|
+
return bridge.create_std__optional_NitroVerifyPurchaseWithIapkitAppleProps_(__unwrappedValue)
|
|
77
|
+
} else {
|
|
78
|
+
return .init()
|
|
79
|
+
}
|
|
80
|
+
}()
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
var google: NitroVerifyPurchaseWithIapkitGoogleProps? {
|
|
85
|
+
@inline(__always)
|
|
86
|
+
get {
|
|
87
|
+
return self.__google.value
|
|
88
|
+
}
|
|
89
|
+
@inline(__always)
|
|
90
|
+
set {
|
|
91
|
+
self.__google = { () -> bridge.std__optional_NitroVerifyPurchaseWithIapkitGoogleProps_ in
|
|
92
|
+
if let __unwrappedValue = newValue {
|
|
93
|
+
return bridge.create_std__optional_NitroVerifyPurchaseWithIapkitGoogleProps_(__unwrappedValue)
|
|
94
|
+
} else {
|
|
95
|
+
return .init()
|
|
96
|
+
}
|
|
97
|
+
}()
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|