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
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
|
|
26
26
|
// Forward declaration of `IapPlatform` to properly resolve imports.
|
|
27
27
|
namespace margelo::nitro::iap { enum class IapPlatform; }
|
|
28
|
+
// Forward declaration of `IapStore` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::iap { enum class IapStore; }
|
|
28
30
|
// Forward declaration of `PurchaseState` to properly resolve imports.
|
|
29
31
|
namespace margelo::nitro::iap { enum class PurchaseState; }
|
|
30
32
|
// Forward declaration of `NitroRenewalInfoIOS` to properly resolve imports.
|
|
@@ -33,6 +35,7 @@ namespace margelo::nitro::iap { struct NitroRenewalInfoIOS; }
|
|
|
33
35
|
#include <string>
|
|
34
36
|
#include <optional>
|
|
35
37
|
#include "IapPlatform.hpp"
|
|
38
|
+
#include "IapStore.hpp"
|
|
36
39
|
#include "PurchaseState.hpp"
|
|
37
40
|
#include "NitroRenewalInfoIOS.hpp"
|
|
38
41
|
|
|
@@ -48,6 +51,7 @@ namespace margelo::nitro::iap {
|
|
|
48
51
|
double transactionDate SWIFT_PRIVATE;
|
|
49
52
|
std::optional<std::string> purchaseToken SWIFT_PRIVATE;
|
|
50
53
|
IapPlatform platform SWIFT_PRIVATE;
|
|
54
|
+
IapStore store SWIFT_PRIVATE;
|
|
51
55
|
double quantity SWIFT_PRIVATE;
|
|
52
56
|
PurchaseState purchaseState SWIFT_PRIVATE;
|
|
53
57
|
bool isAutoRenewing SWIFT_PRIVATE;
|
|
@@ -86,7 +90,7 @@ namespace margelo::nitro::iap {
|
|
|
86
90
|
|
|
87
91
|
public:
|
|
88
92
|
NitroPurchase() = default;
|
|
89
|
-
explicit NitroPurchase(std::string id, std::string productId, double transactionDate, std::optional<std::string> purchaseToken, IapPlatform platform, double quantity, PurchaseState purchaseState, bool isAutoRenewing, std::optional<double> quantityIOS, std::optional<double> originalTransactionDateIOS, std::optional<std::string> originalTransactionIdentifierIOS, std::optional<std::string> appAccountToken, std::optional<std::string> appBundleIdIOS, std::optional<std::string> countryCodeIOS, std::optional<std::string> currencyCodeIOS, std::optional<std::string> currencySymbolIOS, std::optional<std::string> environmentIOS, std::optional<double> expirationDateIOS, std::optional<bool> isUpgradedIOS, std::optional<std::string> offerIOS, std::optional<std::string> ownershipTypeIOS, std::optional<std::string> reasonIOS, std::optional<std::string> reasonStringRepresentationIOS, std::optional<double> revocationDateIOS, std::optional<std::string> revocationReasonIOS, std::optional<std::string> storefrontCountryCodeIOS, std::optional<std::string> subscriptionGroupIdIOS, std::optional<std::string> transactionReasonIOS, std::optional<std::string> webOrderLineItemIdIOS, std::optional<NitroRenewalInfoIOS> renewalInfoIOS, std::optional<std::string> purchaseTokenAndroid, std::optional<std::string> dataAndroid, std::optional<std::string> signatureAndroid, std::optional<bool> autoRenewingAndroid, std::optional<double> purchaseStateAndroid, std::optional<bool> isAcknowledgedAndroid, std::optional<std::string> packageNameAndroid, std::optional<std::string> obfuscatedAccountIdAndroid, std::optional<std::string> obfuscatedProfileIdAndroid, std::optional<std::string> developerPayloadAndroid): id(id), productId(productId), transactionDate(transactionDate), purchaseToken(purchaseToken), platform(platform), quantity(quantity), purchaseState(purchaseState), isAutoRenewing(isAutoRenewing), quantityIOS(quantityIOS), originalTransactionDateIOS(originalTransactionDateIOS), originalTransactionIdentifierIOS(originalTransactionIdentifierIOS), appAccountToken(appAccountToken), appBundleIdIOS(appBundleIdIOS), countryCodeIOS(countryCodeIOS), currencyCodeIOS(currencyCodeIOS), currencySymbolIOS(currencySymbolIOS), environmentIOS(environmentIOS), expirationDateIOS(expirationDateIOS), isUpgradedIOS(isUpgradedIOS), offerIOS(offerIOS), ownershipTypeIOS(ownershipTypeIOS), reasonIOS(reasonIOS), reasonStringRepresentationIOS(reasonStringRepresentationIOS), revocationDateIOS(revocationDateIOS), revocationReasonIOS(revocationReasonIOS), storefrontCountryCodeIOS(storefrontCountryCodeIOS), subscriptionGroupIdIOS(subscriptionGroupIdIOS), transactionReasonIOS(transactionReasonIOS), webOrderLineItemIdIOS(webOrderLineItemIdIOS), renewalInfoIOS(renewalInfoIOS), purchaseTokenAndroid(purchaseTokenAndroid), dataAndroid(dataAndroid), signatureAndroid(signatureAndroid), autoRenewingAndroid(autoRenewingAndroid), purchaseStateAndroid(purchaseStateAndroid), isAcknowledgedAndroid(isAcknowledgedAndroid), packageNameAndroid(packageNameAndroid), obfuscatedAccountIdAndroid(obfuscatedAccountIdAndroid), obfuscatedProfileIdAndroid(obfuscatedProfileIdAndroid), developerPayloadAndroid(developerPayloadAndroid) {}
|
|
93
|
+
explicit NitroPurchase(std::string id, std::string productId, double transactionDate, std::optional<std::string> purchaseToken, IapPlatform platform, IapStore store, double quantity, PurchaseState purchaseState, bool isAutoRenewing, std::optional<double> quantityIOS, std::optional<double> originalTransactionDateIOS, std::optional<std::string> originalTransactionIdentifierIOS, std::optional<std::string> appAccountToken, std::optional<std::string> appBundleIdIOS, std::optional<std::string> countryCodeIOS, std::optional<std::string> currencyCodeIOS, std::optional<std::string> currencySymbolIOS, std::optional<std::string> environmentIOS, std::optional<double> expirationDateIOS, std::optional<bool> isUpgradedIOS, std::optional<std::string> offerIOS, std::optional<std::string> ownershipTypeIOS, std::optional<std::string> reasonIOS, std::optional<std::string> reasonStringRepresentationIOS, std::optional<double> revocationDateIOS, std::optional<std::string> revocationReasonIOS, std::optional<std::string> storefrontCountryCodeIOS, std::optional<std::string> subscriptionGroupIdIOS, std::optional<std::string> transactionReasonIOS, std::optional<std::string> webOrderLineItemIdIOS, std::optional<NitroRenewalInfoIOS> renewalInfoIOS, std::optional<std::string> purchaseTokenAndroid, std::optional<std::string> dataAndroid, std::optional<std::string> signatureAndroid, std::optional<bool> autoRenewingAndroid, std::optional<double> purchaseStateAndroid, std::optional<bool> isAcknowledgedAndroid, std::optional<std::string> packageNameAndroid, std::optional<std::string> obfuscatedAccountIdAndroid, std::optional<std::string> obfuscatedProfileIdAndroid, std::optional<std::string> developerPayloadAndroid): id(id), productId(productId), transactionDate(transactionDate), purchaseToken(purchaseToken), platform(platform), store(store), quantity(quantity), purchaseState(purchaseState), isAutoRenewing(isAutoRenewing), quantityIOS(quantityIOS), originalTransactionDateIOS(originalTransactionDateIOS), originalTransactionIdentifierIOS(originalTransactionIdentifierIOS), appAccountToken(appAccountToken), appBundleIdIOS(appBundleIdIOS), countryCodeIOS(countryCodeIOS), currencyCodeIOS(currencyCodeIOS), currencySymbolIOS(currencySymbolIOS), environmentIOS(environmentIOS), expirationDateIOS(expirationDateIOS), isUpgradedIOS(isUpgradedIOS), offerIOS(offerIOS), ownershipTypeIOS(ownershipTypeIOS), reasonIOS(reasonIOS), reasonStringRepresentationIOS(reasonStringRepresentationIOS), revocationDateIOS(revocationDateIOS), revocationReasonIOS(revocationReasonIOS), storefrontCountryCodeIOS(storefrontCountryCodeIOS), subscriptionGroupIdIOS(subscriptionGroupIdIOS), transactionReasonIOS(transactionReasonIOS), webOrderLineItemIdIOS(webOrderLineItemIdIOS), renewalInfoIOS(renewalInfoIOS), purchaseTokenAndroid(purchaseTokenAndroid), dataAndroid(dataAndroid), signatureAndroid(signatureAndroid), autoRenewingAndroid(autoRenewingAndroid), purchaseStateAndroid(purchaseStateAndroid), isAcknowledgedAndroid(isAcknowledgedAndroid), packageNameAndroid(packageNameAndroid), obfuscatedAccountIdAndroid(obfuscatedAccountIdAndroid), obfuscatedProfileIdAndroid(obfuscatedProfileIdAndroid), developerPayloadAndroid(developerPayloadAndroid) {}
|
|
90
94
|
};
|
|
91
95
|
|
|
92
96
|
} // namespace margelo::nitro::iap
|
|
@@ -104,6 +108,7 @@ namespace margelo::nitro {
|
|
|
104
108
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "transactionDate")),
|
|
105
109
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "purchaseToken")),
|
|
106
110
|
JSIConverter<margelo::nitro::iap::IapPlatform>::fromJSI(runtime, obj.getProperty(runtime, "platform")),
|
|
111
|
+
JSIConverter<margelo::nitro::iap::IapStore>::fromJSI(runtime, obj.getProperty(runtime, "store")),
|
|
107
112
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "quantity")),
|
|
108
113
|
JSIConverter<margelo::nitro::iap::PurchaseState>::fromJSI(runtime, obj.getProperty(runtime, "purchaseState")),
|
|
109
114
|
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "isAutoRenewing")),
|
|
@@ -148,6 +153,7 @@ namespace margelo::nitro {
|
|
|
148
153
|
obj.setProperty(runtime, "transactionDate", JSIConverter<double>::toJSI(runtime, arg.transactionDate));
|
|
149
154
|
obj.setProperty(runtime, "purchaseToken", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.purchaseToken));
|
|
150
155
|
obj.setProperty(runtime, "platform", JSIConverter<margelo::nitro::iap::IapPlatform>::toJSI(runtime, arg.platform));
|
|
156
|
+
obj.setProperty(runtime, "store", JSIConverter<margelo::nitro::iap::IapStore>::toJSI(runtime, arg.store));
|
|
151
157
|
obj.setProperty(runtime, "quantity", JSIConverter<double>::toJSI(runtime, arg.quantity));
|
|
152
158
|
obj.setProperty(runtime, "purchaseState", JSIConverter<margelo::nitro::iap::PurchaseState>::toJSI(runtime, arg.purchaseState));
|
|
153
159
|
obj.setProperty(runtime, "isAutoRenewing", JSIConverter<bool>::toJSI(runtime, arg.isAutoRenewing));
|
|
@@ -198,6 +204,7 @@ namespace margelo::nitro {
|
|
|
198
204
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "transactionDate"))) return false;
|
|
199
205
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "purchaseToken"))) return false;
|
|
200
206
|
if (!JSIConverter<margelo::nitro::iap::IapPlatform>::canConvert(runtime, obj.getProperty(runtime, "platform"))) return false;
|
|
207
|
+
if (!JSIConverter<margelo::nitro::iap::IapStore>::canConvert(runtime, obj.getProperty(runtime, "store"))) return false;
|
|
201
208
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "quantity"))) return false;
|
|
202
209
|
if (!JSIConverter<margelo::nitro::iap::PurchaseState>::canConvert(runtime, obj.getProperty(runtime, "purchaseState"))) return false;
|
|
203
210
|
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "isAutoRenewing"))) return false;
|
|
@@ -41,10 +41,12 @@ namespace margelo::nitro::iap {
|
|
|
41
41
|
public:
|
|
42
42
|
std::optional<NitroRequestPurchaseIos> ios SWIFT_PRIVATE;
|
|
43
43
|
std::optional<NitroRequestPurchaseAndroid> android SWIFT_PRIVATE;
|
|
44
|
+
std::optional<NitroRequestPurchaseIos> apple SWIFT_PRIVATE;
|
|
45
|
+
std::optional<NitroRequestPurchaseAndroid> google SWIFT_PRIVATE;
|
|
44
46
|
|
|
45
47
|
public:
|
|
46
48
|
NitroPurchaseRequest() = default;
|
|
47
|
-
explicit NitroPurchaseRequest(std::optional<NitroRequestPurchaseIos> ios, std::optional<NitroRequestPurchaseAndroid> android): ios(ios), android(android) {}
|
|
49
|
+
explicit NitroPurchaseRequest(std::optional<NitroRequestPurchaseIos> ios, std::optional<NitroRequestPurchaseAndroid> android, std::optional<NitroRequestPurchaseIos> apple, std::optional<NitroRequestPurchaseAndroid> google): ios(ios), android(android), apple(apple), google(google) {}
|
|
48
50
|
};
|
|
49
51
|
|
|
50
52
|
} // namespace margelo::nitro::iap
|
|
@@ -58,13 +60,17 @@ namespace margelo::nitro {
|
|
|
58
60
|
jsi::Object obj = arg.asObject(runtime);
|
|
59
61
|
return margelo::nitro::iap::NitroPurchaseRequest(
|
|
60
62
|
JSIConverter<std::optional<margelo::nitro::iap::NitroRequestPurchaseIos>>::fromJSI(runtime, obj.getProperty(runtime, "ios")),
|
|
61
|
-
JSIConverter<std::optional<margelo::nitro::iap::NitroRequestPurchaseAndroid>>::fromJSI(runtime, obj.getProperty(runtime, "android"))
|
|
63
|
+
JSIConverter<std::optional<margelo::nitro::iap::NitroRequestPurchaseAndroid>>::fromJSI(runtime, obj.getProperty(runtime, "android")),
|
|
64
|
+
JSIConverter<std::optional<margelo::nitro::iap::NitroRequestPurchaseIos>>::fromJSI(runtime, obj.getProperty(runtime, "apple")),
|
|
65
|
+
JSIConverter<std::optional<margelo::nitro::iap::NitroRequestPurchaseAndroid>>::fromJSI(runtime, obj.getProperty(runtime, "google"))
|
|
62
66
|
);
|
|
63
67
|
}
|
|
64
68
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroPurchaseRequest& arg) {
|
|
65
69
|
jsi::Object obj(runtime);
|
|
66
70
|
obj.setProperty(runtime, "ios", JSIConverter<std::optional<margelo::nitro::iap::NitroRequestPurchaseIos>>::toJSI(runtime, arg.ios));
|
|
67
71
|
obj.setProperty(runtime, "android", JSIConverter<std::optional<margelo::nitro::iap::NitroRequestPurchaseAndroid>>::toJSI(runtime, arg.android));
|
|
72
|
+
obj.setProperty(runtime, "apple", JSIConverter<std::optional<margelo::nitro::iap::NitroRequestPurchaseIos>>::toJSI(runtime, arg.apple));
|
|
73
|
+
obj.setProperty(runtime, "google", JSIConverter<std::optional<margelo::nitro::iap::NitroRequestPurchaseAndroid>>::toJSI(runtime, arg.google));
|
|
68
74
|
return obj;
|
|
69
75
|
}
|
|
70
76
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -77,6 +83,8 @@ namespace margelo::nitro {
|
|
|
77
83
|
}
|
|
78
84
|
if (!JSIConverter<std::optional<margelo::nitro::iap::NitroRequestPurchaseIos>>::canConvert(runtime, obj.getProperty(runtime, "ios"))) return false;
|
|
79
85
|
if (!JSIConverter<std::optional<margelo::nitro::iap::NitroRequestPurchaseAndroid>>::canConvert(runtime, obj.getProperty(runtime, "android"))) return false;
|
|
86
|
+
if (!JSIConverter<std::optional<margelo::nitro::iap::NitroRequestPurchaseIos>>::canConvert(runtime, obj.getProperty(runtime, "apple"))) return false;
|
|
87
|
+
if (!JSIConverter<std::optional<margelo::nitro::iap::NitroRequestPurchaseAndroid>>::canConvert(runtime, obj.getProperty(runtime, "google"))) return false;
|
|
80
88
|
return true;
|
|
81
89
|
}
|
|
82
90
|
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroVerifyPurchaseWithIapkitAppleProps.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
#include <string>
|
|
29
|
+
|
|
30
|
+
namespace margelo::nitro::iap {
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A struct which can be represented as a JavaScript object (NitroVerifyPurchaseWithIapkitAppleProps).
|
|
34
|
+
*/
|
|
35
|
+
struct NitroVerifyPurchaseWithIapkitAppleProps {
|
|
36
|
+
public:
|
|
37
|
+
std::string jws SWIFT_PRIVATE;
|
|
38
|
+
|
|
39
|
+
public:
|
|
40
|
+
NitroVerifyPurchaseWithIapkitAppleProps() = default;
|
|
41
|
+
explicit NitroVerifyPurchaseWithIapkitAppleProps(std::string jws): jws(jws) {}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
} // namespace margelo::nitro::iap
|
|
45
|
+
|
|
46
|
+
namespace margelo::nitro {
|
|
47
|
+
|
|
48
|
+
// C++ NitroVerifyPurchaseWithIapkitAppleProps <> JS NitroVerifyPurchaseWithIapkitAppleProps (object)
|
|
49
|
+
template <>
|
|
50
|
+
struct JSIConverter<margelo::nitro::iap::NitroVerifyPurchaseWithIapkitAppleProps> final {
|
|
51
|
+
static inline margelo::nitro::iap::NitroVerifyPurchaseWithIapkitAppleProps fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
52
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
53
|
+
return margelo::nitro::iap::NitroVerifyPurchaseWithIapkitAppleProps(
|
|
54
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "jws"))
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroVerifyPurchaseWithIapkitAppleProps& arg) {
|
|
58
|
+
jsi::Object obj(runtime);
|
|
59
|
+
obj.setProperty(runtime, "jws", JSIConverter<std::string>::toJSI(runtime, arg.jws));
|
|
60
|
+
return obj;
|
|
61
|
+
}
|
|
62
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
63
|
+
if (!value.isObject()) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
jsi::Object obj = value.getObject(runtime);
|
|
67
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "jws"))) return false;
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroVerifyPurchaseWithIapkitGoogleProps.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
#include <string>
|
|
29
|
+
|
|
30
|
+
namespace margelo::nitro::iap {
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A struct which can be represented as a JavaScript object (NitroVerifyPurchaseWithIapkitGoogleProps).
|
|
34
|
+
*/
|
|
35
|
+
struct NitroVerifyPurchaseWithIapkitGoogleProps {
|
|
36
|
+
public:
|
|
37
|
+
std::string purchaseToken SWIFT_PRIVATE;
|
|
38
|
+
|
|
39
|
+
public:
|
|
40
|
+
NitroVerifyPurchaseWithIapkitGoogleProps() = default;
|
|
41
|
+
explicit NitroVerifyPurchaseWithIapkitGoogleProps(std::string purchaseToken): purchaseToken(purchaseToken) {}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
} // namespace margelo::nitro::iap
|
|
45
|
+
|
|
46
|
+
namespace margelo::nitro {
|
|
47
|
+
|
|
48
|
+
// C++ NitroVerifyPurchaseWithIapkitGoogleProps <> JS NitroVerifyPurchaseWithIapkitGoogleProps (object)
|
|
49
|
+
template <>
|
|
50
|
+
struct JSIConverter<margelo::nitro::iap::NitroVerifyPurchaseWithIapkitGoogleProps> final {
|
|
51
|
+
static inline margelo::nitro::iap::NitroVerifyPurchaseWithIapkitGoogleProps fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
52
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
53
|
+
return margelo::nitro::iap::NitroVerifyPurchaseWithIapkitGoogleProps(
|
|
54
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "purchaseToken"))
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroVerifyPurchaseWithIapkitGoogleProps& arg) {
|
|
58
|
+
jsi::Object obj(runtime);
|
|
59
|
+
obj.setProperty(runtime, "purchaseToken", JSIConverter<std::string>::toJSI(runtime, arg.purchaseToken));
|
|
60
|
+
return obj;
|
|
61
|
+
}
|
|
62
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
63
|
+
if (!value.isObject()) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
jsi::Object obj = value.getObject(runtime);
|
|
67
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "purchaseToken"))) return false;
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroVerifyPurchaseWithIapkitProps.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
// Forward declaration of `NitroVerifyPurchaseWithIapkitAppleProps` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitAppleProps; }
|
|
28
|
+
// Forward declaration of `NitroVerifyPurchaseWithIapkitGoogleProps` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitGoogleProps; }
|
|
30
|
+
|
|
31
|
+
#include <string>
|
|
32
|
+
#include <optional>
|
|
33
|
+
#include "NitroVerifyPurchaseWithIapkitAppleProps.hpp"
|
|
34
|
+
#include "NitroVerifyPurchaseWithIapkitGoogleProps.hpp"
|
|
35
|
+
|
|
36
|
+
namespace margelo::nitro::iap {
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A struct which can be represented as a JavaScript object (NitroVerifyPurchaseWithIapkitProps).
|
|
40
|
+
*/
|
|
41
|
+
struct NitroVerifyPurchaseWithIapkitProps {
|
|
42
|
+
public:
|
|
43
|
+
std::optional<std::string> apiKey SWIFT_PRIVATE;
|
|
44
|
+
std::optional<NitroVerifyPurchaseWithIapkitAppleProps> apple SWIFT_PRIVATE;
|
|
45
|
+
std::optional<NitroVerifyPurchaseWithIapkitGoogleProps> google SWIFT_PRIVATE;
|
|
46
|
+
|
|
47
|
+
public:
|
|
48
|
+
NitroVerifyPurchaseWithIapkitProps() = default;
|
|
49
|
+
explicit NitroVerifyPurchaseWithIapkitProps(std::optional<std::string> apiKey, std::optional<NitroVerifyPurchaseWithIapkitAppleProps> apple, std::optional<NitroVerifyPurchaseWithIapkitGoogleProps> google): apiKey(apiKey), apple(apple), google(google) {}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
} // namespace margelo::nitro::iap
|
|
53
|
+
|
|
54
|
+
namespace margelo::nitro {
|
|
55
|
+
|
|
56
|
+
// C++ NitroVerifyPurchaseWithIapkitProps <> JS NitroVerifyPurchaseWithIapkitProps (object)
|
|
57
|
+
template <>
|
|
58
|
+
struct JSIConverter<margelo::nitro::iap::NitroVerifyPurchaseWithIapkitProps> final {
|
|
59
|
+
static inline margelo::nitro::iap::NitroVerifyPurchaseWithIapkitProps fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
60
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
61
|
+
return margelo::nitro::iap::NitroVerifyPurchaseWithIapkitProps(
|
|
62
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "apiKey")),
|
|
63
|
+
JSIConverter<std::optional<margelo::nitro::iap::NitroVerifyPurchaseWithIapkitAppleProps>>::fromJSI(runtime, obj.getProperty(runtime, "apple")),
|
|
64
|
+
JSIConverter<std::optional<margelo::nitro::iap::NitroVerifyPurchaseWithIapkitGoogleProps>>::fromJSI(runtime, obj.getProperty(runtime, "google"))
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroVerifyPurchaseWithIapkitProps& arg) {
|
|
68
|
+
jsi::Object obj(runtime);
|
|
69
|
+
obj.setProperty(runtime, "apiKey", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.apiKey));
|
|
70
|
+
obj.setProperty(runtime, "apple", JSIConverter<std::optional<margelo::nitro::iap::NitroVerifyPurchaseWithIapkitAppleProps>>::toJSI(runtime, arg.apple));
|
|
71
|
+
obj.setProperty(runtime, "google", JSIConverter<std::optional<margelo::nitro::iap::NitroVerifyPurchaseWithIapkitGoogleProps>>::toJSI(runtime, arg.google));
|
|
72
|
+
return obj;
|
|
73
|
+
}
|
|
74
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
75
|
+
if (!value.isObject()) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
jsi::Object obj = value.getObject(runtime);
|
|
79
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "apiKey"))) return false;
|
|
83
|
+
if (!JSIConverter<std::optional<margelo::nitro::iap::NitroVerifyPurchaseWithIapkitAppleProps>>::canConvert(runtime, obj.getProperty(runtime, "apple"))) return false;
|
|
84
|
+
if (!JSIConverter<std::optional<margelo::nitro::iap::NitroVerifyPurchaseWithIapkitGoogleProps>>::canConvert(runtime, obj.getProperty(runtime, "google"))) return false;
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroVerifyPurchaseWithIapkitResult.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
// Forward declaration of `IapkitPurchaseState` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::iap { enum class IapkitPurchaseState; }
|
|
28
|
+
// Forward declaration of `IapStore` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::iap { enum class IapStore; }
|
|
30
|
+
|
|
31
|
+
#include "IapkitPurchaseState.hpp"
|
|
32
|
+
#include "IapStore.hpp"
|
|
33
|
+
|
|
34
|
+
namespace margelo::nitro::iap {
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A struct which can be represented as a JavaScript object (NitroVerifyPurchaseWithIapkitResult).
|
|
38
|
+
*/
|
|
39
|
+
struct NitroVerifyPurchaseWithIapkitResult {
|
|
40
|
+
public:
|
|
41
|
+
bool isValid SWIFT_PRIVATE;
|
|
42
|
+
IapkitPurchaseState state SWIFT_PRIVATE;
|
|
43
|
+
IapStore store SWIFT_PRIVATE;
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
NitroVerifyPurchaseWithIapkitResult() = default;
|
|
47
|
+
explicit NitroVerifyPurchaseWithIapkitResult(bool isValid, IapkitPurchaseState state, IapStore store): isValid(isValid), state(state), store(store) {}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
} // namespace margelo::nitro::iap
|
|
51
|
+
|
|
52
|
+
namespace margelo::nitro {
|
|
53
|
+
|
|
54
|
+
// C++ NitroVerifyPurchaseWithIapkitResult <> JS NitroVerifyPurchaseWithIapkitResult (object)
|
|
55
|
+
template <>
|
|
56
|
+
struct JSIConverter<margelo::nitro::iap::NitroVerifyPurchaseWithIapkitResult> final {
|
|
57
|
+
static inline margelo::nitro::iap::NitroVerifyPurchaseWithIapkitResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
58
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
59
|
+
return margelo::nitro::iap::NitroVerifyPurchaseWithIapkitResult(
|
|
60
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "isValid")),
|
|
61
|
+
JSIConverter<margelo::nitro::iap::IapkitPurchaseState>::fromJSI(runtime, obj.getProperty(runtime, "state")),
|
|
62
|
+
JSIConverter<margelo::nitro::iap::IapStore>::fromJSI(runtime, obj.getProperty(runtime, "store"))
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroVerifyPurchaseWithIapkitResult& arg) {
|
|
66
|
+
jsi::Object obj(runtime);
|
|
67
|
+
obj.setProperty(runtime, "isValid", JSIConverter<bool>::toJSI(runtime, arg.isValid));
|
|
68
|
+
obj.setProperty(runtime, "state", JSIConverter<margelo::nitro::iap::IapkitPurchaseState>::toJSI(runtime, arg.state));
|
|
69
|
+
obj.setProperty(runtime, "store", JSIConverter<margelo::nitro::iap::IapStore>::toJSI(runtime, arg.store));
|
|
70
|
+
return obj;
|
|
71
|
+
}
|
|
72
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
73
|
+
if (!value.isObject()) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
jsi::Object obj = value.getObject(runtime);
|
|
77
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "isValid"))) return false;
|
|
81
|
+
if (!JSIConverter<margelo::nitro::iap::IapkitPurchaseState>::canConvert(runtime, obj.getProperty(runtime, "state"))) return false;
|
|
82
|
+
if (!JSIConverter<margelo::nitro::iap::IapStore>::canConvert(runtime, obj.getProperty(runtime, "store"))) return false;
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroVerifyPurchaseWithProviderError.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
#include <string>
|
|
29
|
+
#include <optional>
|
|
30
|
+
|
|
31
|
+
namespace margelo::nitro::iap {
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* A struct which can be represented as a JavaScript object (NitroVerifyPurchaseWithProviderError).
|
|
35
|
+
*/
|
|
36
|
+
struct NitroVerifyPurchaseWithProviderError {
|
|
37
|
+
public:
|
|
38
|
+
std::optional<std::string> code SWIFT_PRIVATE;
|
|
39
|
+
std::string message SWIFT_PRIVATE;
|
|
40
|
+
|
|
41
|
+
public:
|
|
42
|
+
NitroVerifyPurchaseWithProviderError() = default;
|
|
43
|
+
explicit NitroVerifyPurchaseWithProviderError(std::optional<std::string> code, std::string message): code(code), message(message) {}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
} // namespace margelo::nitro::iap
|
|
47
|
+
|
|
48
|
+
namespace margelo::nitro {
|
|
49
|
+
|
|
50
|
+
// C++ NitroVerifyPurchaseWithProviderError <> JS NitroVerifyPurchaseWithProviderError (object)
|
|
51
|
+
template <>
|
|
52
|
+
struct JSIConverter<margelo::nitro::iap::NitroVerifyPurchaseWithProviderError> final {
|
|
53
|
+
static inline margelo::nitro::iap::NitroVerifyPurchaseWithProviderError fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
54
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
55
|
+
return margelo::nitro::iap::NitroVerifyPurchaseWithProviderError(
|
|
56
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "code")),
|
|
57
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "message"))
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroVerifyPurchaseWithProviderError& arg) {
|
|
61
|
+
jsi::Object obj(runtime);
|
|
62
|
+
obj.setProperty(runtime, "code", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.code));
|
|
63
|
+
obj.setProperty(runtime, "message", JSIConverter<std::string>::toJSI(runtime, arg.message));
|
|
64
|
+
return obj;
|
|
65
|
+
}
|
|
66
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
67
|
+
if (!value.isObject()) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
jsi::Object obj = value.getObject(runtime);
|
|
71
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "code"))) return false;
|
|
75
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "message"))) return false;
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroVerifyPurchaseWithProviderProps.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
// Forward declaration of `NitroVerifyPurchaseWithIapkitProps` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitProps; }
|
|
28
|
+
// Forward declaration of `PurchaseVerificationProvider` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::iap { enum class PurchaseVerificationProvider; }
|
|
30
|
+
|
|
31
|
+
#include "NitroVerifyPurchaseWithIapkitProps.hpp"
|
|
32
|
+
#include <optional>
|
|
33
|
+
#include "PurchaseVerificationProvider.hpp"
|
|
34
|
+
|
|
35
|
+
namespace margelo::nitro::iap {
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A struct which can be represented as a JavaScript object (NitroVerifyPurchaseWithProviderProps).
|
|
39
|
+
*/
|
|
40
|
+
struct NitroVerifyPurchaseWithProviderProps {
|
|
41
|
+
public:
|
|
42
|
+
std::optional<NitroVerifyPurchaseWithIapkitProps> iapkit SWIFT_PRIVATE;
|
|
43
|
+
PurchaseVerificationProvider provider SWIFT_PRIVATE;
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
NitroVerifyPurchaseWithProviderProps() = default;
|
|
47
|
+
explicit NitroVerifyPurchaseWithProviderProps(std::optional<NitroVerifyPurchaseWithIapkitProps> iapkit, PurchaseVerificationProvider provider): iapkit(iapkit), provider(provider) {}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
} // namespace margelo::nitro::iap
|
|
51
|
+
|
|
52
|
+
namespace margelo::nitro {
|
|
53
|
+
|
|
54
|
+
// C++ NitroVerifyPurchaseWithProviderProps <> JS NitroVerifyPurchaseWithProviderProps (object)
|
|
55
|
+
template <>
|
|
56
|
+
struct JSIConverter<margelo::nitro::iap::NitroVerifyPurchaseWithProviderProps> final {
|
|
57
|
+
static inline margelo::nitro::iap::NitroVerifyPurchaseWithProviderProps fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
58
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
59
|
+
return margelo::nitro::iap::NitroVerifyPurchaseWithProviderProps(
|
|
60
|
+
JSIConverter<std::optional<margelo::nitro::iap::NitroVerifyPurchaseWithIapkitProps>>::fromJSI(runtime, obj.getProperty(runtime, "iapkit")),
|
|
61
|
+
JSIConverter<margelo::nitro::iap::PurchaseVerificationProvider>::fromJSI(runtime, obj.getProperty(runtime, "provider"))
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroVerifyPurchaseWithProviderProps& arg) {
|
|
65
|
+
jsi::Object obj(runtime);
|
|
66
|
+
obj.setProperty(runtime, "iapkit", JSIConverter<std::optional<margelo::nitro::iap::NitroVerifyPurchaseWithIapkitProps>>::toJSI(runtime, arg.iapkit));
|
|
67
|
+
obj.setProperty(runtime, "provider", JSIConverter<margelo::nitro::iap::PurchaseVerificationProvider>::toJSI(runtime, arg.provider));
|
|
68
|
+
return obj;
|
|
69
|
+
}
|
|
70
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
71
|
+
if (!value.isObject()) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
jsi::Object obj = value.getObject(runtime);
|
|
75
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
if (!JSIConverter<std::optional<margelo::nitro::iap::NitroVerifyPurchaseWithIapkitProps>>::canConvert(runtime, obj.getProperty(runtime, "iapkit"))) return false;
|
|
79
|
+
if (!JSIConverter<margelo::nitro::iap::PurchaseVerificationProvider>::canConvert(runtime, obj.getProperty(runtime, "provider"))) return false;
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
} // namespace margelo::nitro
|