react-native-iap 15.4.0-rc.3 → 15.4.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.
Files changed (165) hide show
  1. package/README.md +23 -25
  2. package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +250 -168
  3. package/android/src/main/java/com/margelo/nitro/iap/ProductSerialization.kt +98 -0
  4. package/ios/HybridRnIap.swift +19 -1
  5. package/ios/RnIapHelper.swift +30 -2
  6. package/lib/module/hooks/useIAP.js +19 -3
  7. package/lib/module/hooks/useIAP.js.map +1 -1
  8. package/lib/module/index.js +104 -18
  9. package/lib/module/index.js.map +1 -1
  10. package/lib/module/index.kepler.js +3 -0
  11. package/lib/module/index.kepler.js.map +1 -1
  12. package/lib/module/types.js +67 -6
  13. package/lib/module/types.js.map +1 -1
  14. package/lib/module/utils/type-bridge.js +22 -3
  15. package/lib/module/utils/type-bridge.js.map +1 -1
  16. package/lib/module/vega-adapter.js +24 -2
  17. package/lib/module/vega-adapter.js.map +1 -1
  18. package/lib/typescript/src/hooks/useIAP.d.ts +25 -2
  19. package/lib/typescript/src/hooks/useIAP.d.ts.map +1 -1
  20. package/lib/typescript/src/index.d.ts +50 -10
  21. package/lib/typescript/src/index.d.ts.map +1 -1
  22. package/lib/typescript/src/index.kepler.d.ts +3 -0
  23. package/lib/typescript/src/index.kepler.d.ts.map +1 -1
  24. package/lib/typescript/src/specs/RnIap.nitro.d.ts +79 -9
  25. package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
  26. package/lib/typescript/src/types.d.ts +223 -35
  27. package/lib/typescript/src/types.d.ts.map +1 -1
  28. package/lib/typescript/src/utils/type-bridge.d.ts.map +1 -1
  29. package/lib/typescript/src/vega-adapter.d.ts.map +1 -1
  30. package/nitrogen/generated/android/NitroIap+autolinking.cmake +3 -0
  31. package/nitrogen/generated/android/c++/JBillingChoiceImageLayoutAndroid.hpp +61 -0
  32. package/nitrogen/generated/android/c++/JBillingChoiceScreenTypeAndroid.hpp +61 -0
  33. package/nitrogen/generated/android/c++/JBillingProgramAndroid.hpp +3 -0
  34. package/nitrogen/generated/android/c++/JDeveloperBillingLaunchModeAndroid.hpp +61 -0
  35. package/nitrogen/generated/android/c++/JDeveloperBillingOptionParamsAndroid.hpp +78 -0
  36. package/nitrogen/generated/android/c++/JDeveloperBillingTypeAndroid.hpp +61 -0
  37. package/nitrogen/generated/android/c++/JDeveloperProvidedBillingDetailsAndroid.hpp +45 -5
  38. package/nitrogen/generated/android/c++/JDeveloperProvidedBillingProductAndroid.hpp +72 -0
  39. package/nitrogen/generated/android/c++/JFunc_void_DeveloperProvidedBillingDetailsAndroid.hpp +10 -0
  40. package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +118 -3
  41. package/nitrogen/generated/android/c++/JHybridRnIapSpec.hpp +4 -1
  42. package/nitrogen/generated/android/c++/JInAppMessageCategoryAndroid.hpp +58 -0
  43. package/nitrogen/generated/android/c++/JInAppMessageResponseCodeAndroid.hpp +58 -0
  44. package/nitrogen/generated/android/c++/JInitConnectionConfig.hpp +7 -1
  45. package/nitrogen/generated/android/c++/JNitroBillingChoiceInfoAndroid.hpp +66 -0
  46. package/nitrogen/generated/android/c++/JNitroBillingProgramAvailabilityResultAndroid.hpp +18 -3
  47. package/nitrogen/generated/android/c++/JNitroBillingProgramInformationDialogParamsAndroid.hpp +63 -0
  48. package/nitrogen/generated/android/c++/JNitroBillingResultAndroid.hpp +72 -0
  49. package/nitrogen/generated/android/c++/JNitroGetBillingChoiceInfoParamsAndroid.hpp +74 -0
  50. package/nitrogen/generated/android/c++/JNitroInAppMessageParamsAndroid.hpp +64 -0
  51. package/nitrogen/generated/android/c++/JNitroInAppMessageResultAndroid.hpp +68 -0
  52. package/nitrogen/generated/android/c++/JNitroLaunchExternalLinkParamsAndroid.hpp +10 -1
  53. package/nitrogen/generated/android/c++/JNitroOneTimePurchaseOfferDetail.hpp +5 -1
  54. package/nitrogen/generated/android/c++/JNitroProduct.hpp +13 -1
  55. package/nitrogen/generated/android/c++/JNitroPurchaseRequest.hpp +7 -0
  56. package/nitrogen/generated/android/c++/JNitroRequestPurchaseAndroid.hpp +16 -1
  57. package/nitrogen/generated/android/c++/JProductType.hpp +58 -0
  58. package/nitrogen/generated/android/c++/JSubResponseCodeAndroid.hpp +61 -0
  59. package/nitrogen/generated/android/c++/JVariant_NullType_Array_InAppMessageCategoryAndroid_.cpp +35 -0
  60. package/nitrogen/generated/android/c++/JVariant_NullType_Array_InAppMessageCategoryAndroid_.hpp +81 -0
  61. package/nitrogen/generated/android/c++/JVariant_NullType_DeveloperBillingOptionParamsAndroid.cpp +26 -0
  62. package/nitrogen/generated/android/c++/JVariant_NullType_DeveloperBillingOptionParamsAndroid.hpp +78 -0
  63. package/nitrogen/generated/android/c++/JVariant_NullType_InitConnectionConfig.hpp +2 -0
  64. package/nitrogen/generated/android/c++/JVariant_NullType_NitroInAppMessageParamsAndroid.cpp +26 -0
  65. package/nitrogen/generated/android/c++/JVariant_NullType_NitroInAppMessageParamsAndroid.hpp +76 -0
  66. package/nitrogen/generated/android/c++/JVariant_NullType_NitroRequestPurchaseAndroid.hpp +7 -0
  67. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/BillingChoiceImageLayoutAndroid.kt +24 -0
  68. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/BillingChoiceScreenTypeAndroid.kt +24 -0
  69. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/BillingProgramAndroid.kt +2 -1
  70. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/DeveloperBillingLaunchModeAndroid.kt +24 -0
  71. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/DeveloperBillingOptionParamsAndroid.kt +47 -0
  72. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/DeveloperBillingTypeAndroid.kt +24 -0
  73. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/DeveloperProvidedBillingDetailsAndroid.kt +13 -4
  74. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/DeveloperProvidedBillingProductAndroid.kt +44 -0
  75. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +13 -1
  76. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/InAppMessageCategoryAndroid.kt +23 -0
  77. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/InAppMessageResponseCodeAndroid.kt +23 -0
  78. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/InitConnectionConfig.kt +5 -2
  79. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroBillingChoiceInfoAndroid.kt +41 -0
  80. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroBillingProgramAvailabilityResultAndroid.kt +10 -4
  81. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroBillingProgramInformationDialogParamsAndroid.kt +41 -0
  82. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroBillingResultAndroid.kt +44 -0
  83. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroGetBillingChoiceInfoParamsAndroid.kt +44 -0
  84. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroInAppMessageParamsAndroid.kt +38 -0
  85. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroInAppMessageResultAndroid.kt +41 -0
  86. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroLaunchExternalLinkParamsAndroid.kt +6 -3
  87. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroOneTimePurchaseOfferDetail.kt +5 -2
  88. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroProduct.kt +11 -2
  89. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRequestPurchaseAndroid.kt +8 -2
  90. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/ProductType.kt +23 -0
  91. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/SubResponseCodeAndroid.kt +24 -0
  92. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_NullType_Array_InAppMessageCategoryAndroid_.kt +53 -0
  93. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_NullType_DeveloperBillingOptionParamsAndroid.kt +53 -0
  94. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_NullType_NitroInAppMessageParamsAndroid.kt +53 -0
  95. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.cpp +24 -0
  96. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +382 -0
  97. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +48 -0
  98. package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +74 -2
  99. package/nitrogen/generated/ios/swift/BillingChoiceImageLayoutAndroid.swift +44 -0
  100. package/nitrogen/generated/ios/swift/BillingChoiceScreenTypeAndroid.swift +44 -0
  101. package/nitrogen/generated/ios/swift/BillingProgramAndroid.swift +4 -0
  102. package/nitrogen/generated/ios/swift/DeveloperBillingLaunchModeAndroid.swift +44 -0
  103. package/nitrogen/generated/ios/swift/DeveloperBillingOptionParamsAndroid.swift +114 -0
  104. package/nitrogen/generated/ios/swift/DeveloperBillingTypeAndroid.swift +44 -0
  105. package/nitrogen/generated/ios/swift/DeveloperProvidedBillingDetailsAndroid.swift +121 -4
  106. package/nitrogen/generated/ios/swift/DeveloperProvidedBillingProductAndroid.swift +71 -0
  107. package/nitrogen/generated/ios/swift/Func_void_NitroBillingChoiceInfoAndroid.swift +46 -0
  108. package/nitrogen/generated/ios/swift/Func_void_NitroBillingResultAndroid.swift +46 -0
  109. package/nitrogen/generated/ios/swift/Func_void_NitroInAppMessageResultAndroid.swift +46 -0
  110. package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +4 -1
  111. package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +78 -2
  112. package/nitrogen/generated/ios/swift/InAppMessageCategoryAndroid.swift +40 -0
  113. package/nitrogen/generated/ios/swift/InAppMessageResponseCodeAndroid.swift +40 -0
  114. package/nitrogen/generated/ios/swift/InitConnectionConfig.swift +12 -1
  115. package/nitrogen/generated/ios/swift/NitroBillingChoiceInfoAndroid.swift +66 -0
  116. package/nitrogen/generated/ios/swift/NitroBillingProgramAvailabilityResultAndroid.swift +50 -2
  117. package/nitrogen/generated/ios/swift/NitroBillingProgramInformationDialogParamsAndroid.swift +34 -0
  118. package/nitrogen/generated/ios/swift/NitroBillingResultAndroid.swift +77 -0
  119. package/nitrogen/generated/ios/swift/NitroGetBillingChoiceInfoParamsAndroid.swift +71 -0
  120. package/nitrogen/generated/ios/swift/NitroInAppMessageParamsAndroid.swift +67 -0
  121. package/nitrogen/generated/ios/swift/NitroInAppMessageResultAndroid.swift +66 -0
  122. package/nitrogen/generated/ios/swift/NitroLaunchExternalLinkParamsAndroid.swift +39 -2
  123. package/nitrogen/generated/ios/swift/NitroOneTimePurchaseOfferDetail.swift +39 -2
  124. package/nitrogen/generated/ios/swift/NitroProduct.swift +113 -2
  125. package/nitrogen/generated/ios/swift/NitroRequestPurchaseAndroid.swift +75 -1
  126. package/nitrogen/generated/ios/swift/ProductType.swift +40 -0
  127. package/nitrogen/generated/ios/swift/SubResponseCodeAndroid.swift +44 -0
  128. package/nitrogen/generated/ios/swift/Variant_NullType_DeveloperBillingOptionParamsAndroid.swift +18 -0
  129. package/nitrogen/generated/ios/swift/Variant_NullType_NitroInAppMessageParamsAndroid.swift +18 -0
  130. package/nitrogen/generated/ios/swift/Variant_NullType__InAppMessageCategoryAndroid_.swift +18 -0
  131. package/nitrogen/generated/shared/c++/BillingChoiceImageLayoutAndroid.hpp +80 -0
  132. package/nitrogen/generated/shared/c++/BillingChoiceScreenTypeAndroid.hpp +80 -0
  133. package/nitrogen/generated/shared/c++/BillingProgramAndroid.hpp +4 -0
  134. package/nitrogen/generated/shared/c++/DeveloperBillingLaunchModeAndroid.hpp +80 -0
  135. package/nitrogen/generated/shared/c++/DeveloperBillingOptionParamsAndroid.hpp +103 -0
  136. package/nitrogen/generated/shared/c++/DeveloperBillingTypeAndroid.hpp +80 -0
  137. package/nitrogen/generated/shared/c++/DeveloperProvidedBillingDetailsAndroid.hpp +24 -6
  138. package/nitrogen/generated/shared/c++/DeveloperProvidedBillingProductAndroid.hpp +96 -0
  139. package/nitrogen/generated/shared/c++/HybridRnIapSpec.cpp +3 -0
  140. package/nitrogen/generated/shared/c++/HybridRnIapSpec.hpp +25 -1
  141. package/nitrogen/generated/shared/c++/InAppMessageCategoryAndroid.hpp +76 -0
  142. package/nitrogen/generated/shared/c++/InAppMessageResponseCodeAndroid.hpp +76 -0
  143. package/nitrogen/generated/shared/c++/InitConnectionConfig.hpp +8 -1
  144. package/nitrogen/generated/shared/c++/NitroBillingChoiceInfoAndroid.hpp +90 -0
  145. package/nitrogen/generated/shared/c++/NitroBillingProgramAvailabilityResultAndroid.hpp +16 -2
  146. package/nitrogen/generated/shared/c++/NitroBillingProgramInformationDialogParamsAndroid.hpp +89 -0
  147. package/nitrogen/generated/shared/c++/NitroBillingResultAndroid.hpp +96 -0
  148. package/nitrogen/generated/shared/c++/NitroGetBillingChoiceInfoParamsAndroid.hpp +99 -0
  149. package/nitrogen/generated/shared/c++/NitroInAppMessageParamsAndroid.hpp +88 -0
  150. package/nitrogen/generated/shared/c++/NitroInAppMessageResultAndroid.hpp +92 -0
  151. package/nitrogen/generated/shared/c++/NitroLaunchExternalLinkParamsAndroid.hpp +9 -2
  152. package/nitrogen/generated/shared/c++/NitroOneTimePurchaseOfferDetail.hpp +5 -1
  153. package/nitrogen/generated/shared/c++/NitroProduct.hpp +13 -1
  154. package/nitrogen/generated/shared/c++/NitroRequestPurchaseAndroid.hpp +12 -1
  155. package/nitrogen/generated/shared/c++/ProductType.hpp +76 -0
  156. package/nitrogen/generated/shared/c++/SubResponseCodeAndroid.hpp +80 -0
  157. package/openiap-versions.json +3 -3
  158. package/package.json +1 -1
  159. package/src/hooks/useIAP.ts +63 -0
  160. package/src/index.kepler.ts +9 -0
  161. package/src/index.ts +223 -95
  162. package/src/specs/RnIap.nitro.ts +116 -8
  163. package/src/types.ts +238 -35
  164. package/src/utils/type-bridge.ts +26 -2
  165. package/src/vega-adapter.ts +46 -11
@@ -30,8 +30,14 @@
30
30
 
31
31
  // Forward declaration of `BillingProgramAndroid` to properly resolve imports.
32
32
  namespace margelo::nitro::iap { enum class BillingProgramAndroid; }
33
+ // Forward declaration of `BillingChoiceScreenTypeAndroid` to properly resolve imports.
34
+ namespace margelo::nitro::iap { enum class BillingChoiceScreenTypeAndroid; }
33
35
 
34
36
  #include "BillingProgramAndroid.hpp"
37
+ #include "BillingChoiceScreenTypeAndroid.hpp"
38
+ #include <optional>
39
+ #include <NitroModules/Null.hpp>
40
+ #include <variant>
35
41
 
36
42
  namespace margelo::nitro::iap {
37
43
 
@@ -41,11 +47,13 @@ namespace margelo::nitro::iap {
41
47
  struct NitroBillingProgramAvailabilityResultAndroid final {
42
48
  public:
43
49
  BillingProgramAndroid billingProgram SWIFT_PRIVATE;
50
+ std::optional<BillingChoiceScreenTypeAndroid> choiceScreenType SWIFT_PRIVATE;
44
51
  bool isAvailable SWIFT_PRIVATE;
52
+ std::optional<std::variant<nitro::NullType, bool>> isExternalLinkAvailable SWIFT_PRIVATE;
45
53
 
46
54
  public:
47
55
  NitroBillingProgramAvailabilityResultAndroid() = default;
48
- explicit NitroBillingProgramAvailabilityResultAndroid(BillingProgramAndroid billingProgram, bool isAvailable): billingProgram(billingProgram), isAvailable(isAvailable) {}
56
+ explicit NitroBillingProgramAvailabilityResultAndroid(BillingProgramAndroid billingProgram, std::optional<BillingChoiceScreenTypeAndroid> choiceScreenType, bool isAvailable, std::optional<std::variant<nitro::NullType, bool>> isExternalLinkAvailable): billingProgram(billingProgram), choiceScreenType(choiceScreenType), isAvailable(isAvailable), isExternalLinkAvailable(isExternalLinkAvailable) {}
49
57
 
50
58
  public:
51
59
  friend bool operator==(const NitroBillingProgramAvailabilityResultAndroid& lhs, const NitroBillingProgramAvailabilityResultAndroid& rhs) = default;
@@ -62,13 +70,17 @@ namespace margelo::nitro {
62
70
  jsi::Object obj = arg.asObject(runtime);
63
71
  return margelo::nitro::iap::NitroBillingProgramAvailabilityResultAndroid(
64
72
  JSIConverter<margelo::nitro::iap::BillingProgramAndroid>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "billingProgram"))),
65
- JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isAvailable")))
73
+ JSIConverter<std::optional<margelo::nitro::iap::BillingChoiceScreenTypeAndroid>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "choiceScreenType"))),
74
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isAvailable"))),
75
+ JSIConverter<std::optional<std::variant<nitro::NullType, bool>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isExternalLinkAvailable")))
66
76
  );
67
77
  }
68
78
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroBillingProgramAvailabilityResultAndroid& arg) {
69
79
  jsi::Object obj(runtime);
70
80
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "billingProgram"), JSIConverter<margelo::nitro::iap::BillingProgramAndroid>::toJSI(runtime, arg.billingProgram));
81
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "choiceScreenType"), JSIConverter<std::optional<margelo::nitro::iap::BillingChoiceScreenTypeAndroid>>::toJSI(runtime, arg.choiceScreenType));
71
82
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "isAvailable"), JSIConverter<bool>::toJSI(runtime, arg.isAvailable));
83
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "isExternalLinkAvailable"), JSIConverter<std::optional<std::variant<nitro::NullType, bool>>>::toJSI(runtime, arg.isExternalLinkAvailable));
72
84
  return obj;
73
85
  }
74
86
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -80,7 +92,9 @@ namespace margelo::nitro {
80
92
  return false;
81
93
  }
82
94
  if (!JSIConverter<margelo::nitro::iap::BillingProgramAndroid>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "billingProgram")))) return false;
95
+ if (!JSIConverter<std::optional<margelo::nitro::iap::BillingChoiceScreenTypeAndroid>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "choiceScreenType")))) return false;
83
96
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isAvailable")))) return false;
97
+ if (!JSIConverter<std::optional<std::variant<nitro::NullType, bool>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isExternalLinkAvailable")))) return false;
84
98
  return true;
85
99
  }
86
100
  };
@@ -0,0 +1,89 @@
1
+ ///
2
+ /// NitroBillingProgramInformationDialogParamsAndroid.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 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
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+ // Forward declaration of `BillingProgramAndroid` to properly resolve imports.
32
+ namespace margelo::nitro::iap { enum class BillingProgramAndroid; }
33
+
34
+ #include "BillingProgramAndroid.hpp"
35
+ #include <string>
36
+
37
+ namespace margelo::nitro::iap {
38
+
39
+ /**
40
+ * A struct which can be represented as a JavaScript object (NitroBillingProgramInformationDialogParamsAndroid).
41
+ */
42
+ struct NitroBillingProgramInformationDialogParamsAndroid final {
43
+ public:
44
+ BillingProgramAndroid billingProgram SWIFT_PRIVATE;
45
+ std::string externalTransactionToken SWIFT_PRIVATE;
46
+
47
+ public:
48
+ NitroBillingProgramInformationDialogParamsAndroid() = default;
49
+ explicit NitroBillingProgramInformationDialogParamsAndroid(BillingProgramAndroid billingProgram, std::string externalTransactionToken): billingProgram(billingProgram), externalTransactionToken(externalTransactionToken) {}
50
+
51
+ public:
52
+ friend bool operator==(const NitroBillingProgramInformationDialogParamsAndroid& lhs, const NitroBillingProgramInformationDialogParamsAndroid& rhs) = default;
53
+ };
54
+
55
+ } // namespace margelo::nitro::iap
56
+
57
+ namespace margelo::nitro {
58
+
59
+ // C++ NitroBillingProgramInformationDialogParamsAndroid <> JS NitroBillingProgramInformationDialogParamsAndroid (object)
60
+ template <>
61
+ struct JSIConverter<margelo::nitro::iap::NitroBillingProgramInformationDialogParamsAndroid> final {
62
+ static inline margelo::nitro::iap::NitroBillingProgramInformationDialogParamsAndroid fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
63
+ jsi::Object obj = arg.asObject(runtime);
64
+ return margelo::nitro::iap::NitroBillingProgramInformationDialogParamsAndroid(
65
+ JSIConverter<margelo::nitro::iap::BillingProgramAndroid>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "billingProgram"))),
66
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "externalTransactionToken")))
67
+ );
68
+ }
69
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroBillingProgramInformationDialogParamsAndroid& arg) {
70
+ jsi::Object obj(runtime);
71
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "billingProgram"), JSIConverter<margelo::nitro::iap::BillingProgramAndroid>::toJSI(runtime, arg.billingProgram));
72
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "externalTransactionToken"), JSIConverter<std::string>::toJSI(runtime, arg.externalTransactionToken));
73
+ return obj;
74
+ }
75
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
76
+ if (!value.isObject()) {
77
+ return false;
78
+ }
79
+ jsi::Object obj = value.getObject(runtime);
80
+ if (!nitro::isPlainObject(runtime, obj)) {
81
+ return false;
82
+ }
83
+ if (!JSIConverter<margelo::nitro::iap::BillingProgramAndroid>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "billingProgram")))) return false;
84
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "externalTransactionToken")))) return false;
85
+ return true;
86
+ }
87
+ };
88
+
89
+ } // namespace margelo::nitro
@@ -0,0 +1,96 @@
1
+ ///
2
+ /// NitroBillingResultAndroid.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 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
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+ // Forward declaration of `SubResponseCodeAndroid` to properly resolve imports.
32
+ namespace margelo::nitro::iap { enum class SubResponseCodeAndroid; }
33
+
34
+ #include <NitroModules/Null.hpp>
35
+ #include <string>
36
+ #include <variant>
37
+ #include <optional>
38
+ #include "SubResponseCodeAndroid.hpp"
39
+
40
+ namespace margelo::nitro::iap {
41
+
42
+ /**
43
+ * A struct which can be represented as a JavaScript object (NitroBillingResultAndroid).
44
+ */
45
+ struct NitroBillingResultAndroid final {
46
+ public:
47
+ double responseCode SWIFT_PRIVATE;
48
+ std::optional<std::variant<nitro::NullType, std::string>> debugMessage SWIFT_PRIVATE;
49
+ std::optional<SubResponseCodeAndroid> subResponseCode SWIFT_PRIVATE;
50
+
51
+ public:
52
+ NitroBillingResultAndroid() = default;
53
+ explicit NitroBillingResultAndroid(double responseCode, std::optional<std::variant<nitro::NullType, std::string>> debugMessage, std::optional<SubResponseCodeAndroid> subResponseCode): responseCode(responseCode), debugMessage(debugMessage), subResponseCode(subResponseCode) {}
54
+
55
+ public:
56
+ friend bool operator==(const NitroBillingResultAndroid& lhs, const NitroBillingResultAndroid& rhs) = default;
57
+ };
58
+
59
+ } // namespace margelo::nitro::iap
60
+
61
+ namespace margelo::nitro {
62
+
63
+ // C++ NitroBillingResultAndroid <> JS NitroBillingResultAndroid (object)
64
+ template <>
65
+ struct JSIConverter<margelo::nitro::iap::NitroBillingResultAndroid> final {
66
+ static inline margelo::nitro::iap::NitroBillingResultAndroid fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
67
+ jsi::Object obj = arg.asObject(runtime);
68
+ return margelo::nitro::iap::NitroBillingResultAndroid(
69
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "responseCode"))),
70
+ JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "debugMessage"))),
71
+ JSIConverter<std::optional<margelo::nitro::iap::SubResponseCodeAndroid>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "subResponseCode")))
72
+ );
73
+ }
74
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroBillingResultAndroid& arg) {
75
+ jsi::Object obj(runtime);
76
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "responseCode"), JSIConverter<double>::toJSI(runtime, arg.responseCode));
77
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "debugMessage"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.debugMessage));
78
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "subResponseCode"), JSIConverter<std::optional<margelo::nitro::iap::SubResponseCodeAndroid>>::toJSI(runtime, arg.subResponseCode));
79
+ return obj;
80
+ }
81
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
82
+ if (!value.isObject()) {
83
+ return false;
84
+ }
85
+ jsi::Object obj = value.getObject(runtime);
86
+ if (!nitro::isPlainObject(runtime, obj)) {
87
+ return false;
88
+ }
89
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "responseCode")))) return false;
90
+ if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "debugMessage")))) return false;
91
+ if (!JSIConverter<std::optional<margelo::nitro::iap::SubResponseCodeAndroid>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "subResponseCode")))) return false;
92
+ return true;
93
+ }
94
+ };
95
+
96
+ } // namespace margelo::nitro
@@ -0,0 +1,99 @@
1
+ ///
2
+ /// NitroGetBillingChoiceInfoParamsAndroid.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 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
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+ // Forward declaration of `BillingProgramAndroid` to properly resolve imports.
32
+ namespace margelo::nitro::iap { enum class BillingProgramAndroid; }
33
+ // Forward declaration of `BillingChoiceImageLayoutAndroid` to properly resolve imports.
34
+ namespace margelo::nitro::iap { enum class BillingChoiceImageLayoutAndroid; }
35
+
36
+ #include "BillingProgramAndroid.hpp"
37
+ #include "BillingChoiceImageLayoutAndroid.hpp"
38
+ #include <NitroModules/Null.hpp>
39
+ #include <string>
40
+ #include <variant>
41
+ #include <optional>
42
+
43
+ namespace margelo::nitro::iap {
44
+
45
+ /**
46
+ * A struct which can be represented as a JavaScript object (NitroGetBillingChoiceInfoParamsAndroid).
47
+ */
48
+ struct NitroGetBillingChoiceInfoParamsAndroid final {
49
+ public:
50
+ BillingProgramAndroid billingProgram SWIFT_PRIVATE;
51
+ BillingChoiceImageLayoutAndroid playBillingChoiceImageLayout SWIFT_PRIVATE;
52
+ std::optional<std::variant<nitro::NullType, std::string>> userLocale SWIFT_PRIVATE;
53
+
54
+ public:
55
+ NitroGetBillingChoiceInfoParamsAndroid() = default;
56
+ explicit NitroGetBillingChoiceInfoParamsAndroid(BillingProgramAndroid billingProgram, BillingChoiceImageLayoutAndroid playBillingChoiceImageLayout, std::optional<std::variant<nitro::NullType, std::string>> userLocale): billingProgram(billingProgram), playBillingChoiceImageLayout(playBillingChoiceImageLayout), userLocale(userLocale) {}
57
+
58
+ public:
59
+ friend bool operator==(const NitroGetBillingChoiceInfoParamsAndroid& lhs, const NitroGetBillingChoiceInfoParamsAndroid& rhs) = default;
60
+ };
61
+
62
+ } // namespace margelo::nitro::iap
63
+
64
+ namespace margelo::nitro {
65
+
66
+ // C++ NitroGetBillingChoiceInfoParamsAndroid <> JS NitroGetBillingChoiceInfoParamsAndroid (object)
67
+ template <>
68
+ struct JSIConverter<margelo::nitro::iap::NitroGetBillingChoiceInfoParamsAndroid> final {
69
+ static inline margelo::nitro::iap::NitroGetBillingChoiceInfoParamsAndroid fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
70
+ jsi::Object obj = arg.asObject(runtime);
71
+ return margelo::nitro::iap::NitroGetBillingChoiceInfoParamsAndroid(
72
+ JSIConverter<margelo::nitro::iap::BillingProgramAndroid>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "billingProgram"))),
73
+ JSIConverter<margelo::nitro::iap::BillingChoiceImageLayoutAndroid>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "playBillingChoiceImageLayout"))),
74
+ JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "userLocale")))
75
+ );
76
+ }
77
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroGetBillingChoiceInfoParamsAndroid& arg) {
78
+ jsi::Object obj(runtime);
79
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "billingProgram"), JSIConverter<margelo::nitro::iap::BillingProgramAndroid>::toJSI(runtime, arg.billingProgram));
80
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "playBillingChoiceImageLayout"), JSIConverter<margelo::nitro::iap::BillingChoiceImageLayoutAndroid>::toJSI(runtime, arg.playBillingChoiceImageLayout));
81
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "userLocale"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.userLocale));
82
+ return obj;
83
+ }
84
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
85
+ if (!value.isObject()) {
86
+ return false;
87
+ }
88
+ jsi::Object obj = value.getObject(runtime);
89
+ if (!nitro::isPlainObject(runtime, obj)) {
90
+ return false;
91
+ }
92
+ if (!JSIConverter<margelo::nitro::iap::BillingProgramAndroid>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "billingProgram")))) return false;
93
+ if (!JSIConverter<margelo::nitro::iap::BillingChoiceImageLayoutAndroid>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "playBillingChoiceImageLayout")))) return false;
94
+ if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "userLocale")))) return false;
95
+ return true;
96
+ }
97
+ };
98
+
99
+ } // namespace margelo::nitro
@@ -0,0 +1,88 @@
1
+ ///
2
+ /// NitroInAppMessageParamsAndroid.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 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
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+ // Forward declaration of `InAppMessageCategoryAndroid` to properly resolve imports.
32
+ namespace margelo::nitro::iap { enum class InAppMessageCategoryAndroid; }
33
+
34
+ #include <NitroModules/Null.hpp>
35
+ #include "InAppMessageCategoryAndroid.hpp"
36
+ #include <vector>
37
+ #include <variant>
38
+ #include <optional>
39
+
40
+ namespace margelo::nitro::iap {
41
+
42
+ /**
43
+ * A struct which can be represented as a JavaScript object (NitroInAppMessageParamsAndroid).
44
+ */
45
+ struct NitroInAppMessageParamsAndroid final {
46
+ public:
47
+ std::optional<std::variant<nitro::NullType, std::vector<InAppMessageCategoryAndroid>>> categories SWIFT_PRIVATE;
48
+
49
+ public:
50
+ NitroInAppMessageParamsAndroid() = default;
51
+ explicit NitroInAppMessageParamsAndroid(std::optional<std::variant<nitro::NullType, std::vector<InAppMessageCategoryAndroid>>> categories): categories(categories) {}
52
+
53
+ public:
54
+ friend bool operator==(const NitroInAppMessageParamsAndroid& lhs, const NitroInAppMessageParamsAndroid& rhs) = default;
55
+ };
56
+
57
+ } // namespace margelo::nitro::iap
58
+
59
+ namespace margelo::nitro {
60
+
61
+ // C++ NitroInAppMessageParamsAndroid <> JS NitroInAppMessageParamsAndroid (object)
62
+ template <>
63
+ struct JSIConverter<margelo::nitro::iap::NitroInAppMessageParamsAndroid> final {
64
+ static inline margelo::nitro::iap::NitroInAppMessageParamsAndroid fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
65
+ jsi::Object obj = arg.asObject(runtime);
66
+ return margelo::nitro::iap::NitroInAppMessageParamsAndroid(
67
+ JSIConverter<std::optional<std::variant<nitro::NullType, std::vector<margelo::nitro::iap::InAppMessageCategoryAndroid>>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "categories")))
68
+ );
69
+ }
70
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroInAppMessageParamsAndroid& arg) {
71
+ jsi::Object obj(runtime);
72
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "categories"), JSIConverter<std::optional<std::variant<nitro::NullType, std::vector<margelo::nitro::iap::InAppMessageCategoryAndroid>>>>::toJSI(runtime, arg.categories));
73
+ return obj;
74
+ }
75
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
76
+ if (!value.isObject()) {
77
+ return false;
78
+ }
79
+ jsi::Object obj = value.getObject(runtime);
80
+ if (!nitro::isPlainObject(runtime, obj)) {
81
+ return false;
82
+ }
83
+ if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::vector<margelo::nitro::iap::InAppMessageCategoryAndroid>>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "categories")))) return false;
84
+ return true;
85
+ }
86
+ };
87
+
88
+ } // namespace margelo::nitro
@@ -0,0 +1,92 @@
1
+ ///
2
+ /// NitroInAppMessageResultAndroid.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 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
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+ // Forward declaration of `InAppMessageResponseCodeAndroid` to properly resolve imports.
32
+ namespace margelo::nitro::iap { enum class InAppMessageResponseCodeAndroid; }
33
+
34
+ #include "InAppMessageResponseCodeAndroid.hpp"
35
+ #include <NitroModules/Null.hpp>
36
+ #include <string>
37
+ #include <variant>
38
+ #include <optional>
39
+
40
+ namespace margelo::nitro::iap {
41
+
42
+ /**
43
+ * A struct which can be represented as a JavaScript object (NitroInAppMessageResultAndroid).
44
+ */
45
+ struct NitroInAppMessageResultAndroid final {
46
+ public:
47
+ InAppMessageResponseCodeAndroid responseCode SWIFT_PRIVATE;
48
+ std::optional<std::variant<nitro::NullType, std::string>> purchaseToken SWIFT_PRIVATE;
49
+
50
+ public:
51
+ NitroInAppMessageResultAndroid() = default;
52
+ explicit NitroInAppMessageResultAndroid(InAppMessageResponseCodeAndroid responseCode, std::optional<std::variant<nitro::NullType, std::string>> purchaseToken): responseCode(responseCode), purchaseToken(purchaseToken) {}
53
+
54
+ public:
55
+ friend bool operator==(const NitroInAppMessageResultAndroid& lhs, const NitroInAppMessageResultAndroid& rhs) = default;
56
+ };
57
+
58
+ } // namespace margelo::nitro::iap
59
+
60
+ namespace margelo::nitro {
61
+
62
+ // C++ NitroInAppMessageResultAndroid <> JS NitroInAppMessageResultAndroid (object)
63
+ template <>
64
+ struct JSIConverter<margelo::nitro::iap::NitroInAppMessageResultAndroid> final {
65
+ static inline margelo::nitro::iap::NitroInAppMessageResultAndroid fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
66
+ jsi::Object obj = arg.asObject(runtime);
67
+ return margelo::nitro::iap::NitroInAppMessageResultAndroid(
68
+ JSIConverter<margelo::nitro::iap::InAppMessageResponseCodeAndroid>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "responseCode"))),
69
+ JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "purchaseToken")))
70
+ );
71
+ }
72
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroInAppMessageResultAndroid& arg) {
73
+ jsi::Object obj(runtime);
74
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "responseCode"), JSIConverter<margelo::nitro::iap::InAppMessageResponseCodeAndroid>::toJSI(runtime, arg.responseCode));
75
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "purchaseToken"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.purchaseToken));
76
+ return obj;
77
+ }
78
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
79
+ if (!value.isObject()) {
80
+ return false;
81
+ }
82
+ jsi::Object obj = value.getObject(runtime);
83
+ if (!nitro::isPlainObject(runtime, obj)) {
84
+ return false;
85
+ }
86
+ if (!JSIConverter<margelo::nitro::iap::InAppMessageResponseCodeAndroid>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "responseCode")))) return false;
87
+ if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "purchaseToken")))) return false;
88
+ return true;
89
+ }
90
+ };
91
+
92
+ } // namespace margelo::nitro
@@ -36,9 +36,12 @@ namespace margelo::nitro::iap { enum class ExternalLinkLaunchModeAndroid; }
36
36
  namespace margelo::nitro::iap { enum class ExternalLinkTypeAndroid; }
37
37
 
38
38
  #include "BillingProgramAndroid.hpp"
39
+ #include <NitroModules/Null.hpp>
40
+ #include <string>
41
+ #include <variant>
42
+ #include <optional>
39
43
  #include "ExternalLinkLaunchModeAndroid.hpp"
40
44
  #include "ExternalLinkTypeAndroid.hpp"
41
- #include <string>
42
45
 
43
46
  namespace margelo::nitro::iap {
44
47
 
@@ -48,13 +51,14 @@ namespace margelo::nitro::iap {
48
51
  struct NitroLaunchExternalLinkParamsAndroid final {
49
52
  public:
50
53
  BillingProgramAndroid billingProgram SWIFT_PRIVATE;
54
+ std::optional<std::variant<nitro::NullType, std::string>> externalTransactionToken SWIFT_PRIVATE;
51
55
  ExternalLinkLaunchModeAndroid launchMode SWIFT_PRIVATE;
52
56
  ExternalLinkTypeAndroid linkType SWIFT_PRIVATE;
53
57
  std::string linkUri SWIFT_PRIVATE;
54
58
 
55
59
  public:
56
60
  NitroLaunchExternalLinkParamsAndroid() = default;
57
- explicit NitroLaunchExternalLinkParamsAndroid(BillingProgramAndroid billingProgram, ExternalLinkLaunchModeAndroid launchMode, ExternalLinkTypeAndroid linkType, std::string linkUri): billingProgram(billingProgram), launchMode(launchMode), linkType(linkType), linkUri(linkUri) {}
61
+ explicit NitroLaunchExternalLinkParamsAndroid(BillingProgramAndroid billingProgram, std::optional<std::variant<nitro::NullType, std::string>> externalTransactionToken, ExternalLinkLaunchModeAndroid launchMode, ExternalLinkTypeAndroid linkType, std::string linkUri): billingProgram(billingProgram), externalTransactionToken(externalTransactionToken), launchMode(launchMode), linkType(linkType), linkUri(linkUri) {}
58
62
 
59
63
  public:
60
64
  friend bool operator==(const NitroLaunchExternalLinkParamsAndroid& lhs, const NitroLaunchExternalLinkParamsAndroid& rhs) = default;
@@ -71,6 +75,7 @@ namespace margelo::nitro {
71
75
  jsi::Object obj = arg.asObject(runtime);
72
76
  return margelo::nitro::iap::NitroLaunchExternalLinkParamsAndroid(
73
77
  JSIConverter<margelo::nitro::iap::BillingProgramAndroid>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "billingProgram"))),
78
+ JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "externalTransactionToken"))),
74
79
  JSIConverter<margelo::nitro::iap::ExternalLinkLaunchModeAndroid>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "launchMode"))),
75
80
  JSIConverter<margelo::nitro::iap::ExternalLinkTypeAndroid>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "linkType"))),
76
81
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "linkUri")))
@@ -79,6 +84,7 @@ namespace margelo::nitro {
79
84
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroLaunchExternalLinkParamsAndroid& arg) {
80
85
  jsi::Object obj(runtime);
81
86
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "billingProgram"), JSIConverter<margelo::nitro::iap::BillingProgramAndroid>::toJSI(runtime, arg.billingProgram));
87
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "externalTransactionToken"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.externalTransactionToken));
82
88
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "launchMode"), JSIConverter<margelo::nitro::iap::ExternalLinkLaunchModeAndroid>::toJSI(runtime, arg.launchMode));
83
89
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "linkType"), JSIConverter<margelo::nitro::iap::ExternalLinkTypeAndroid>::toJSI(runtime, arg.linkType));
84
90
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "linkUri"), JSIConverter<std::string>::toJSI(runtime, arg.linkUri));
@@ -93,6 +99,7 @@ namespace margelo::nitro {
93
99
  return false;
94
100
  }
95
101
  if (!JSIConverter<margelo::nitro::iap::BillingProgramAndroid>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "billingProgram")))) return false;
102
+ if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "externalTransactionToken")))) return false;
96
103
  if (!JSIConverter<margelo::nitro::iap::ExternalLinkLaunchModeAndroid>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "launchMode")))) return false;
97
104
  if (!JSIConverter<margelo::nitro::iap::ExternalLinkTypeAndroid>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "linkType")))) return false;
98
105
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "linkUri")))) return false;
@@ -67,12 +67,13 @@ namespace margelo::nitro::iap {
67
67
  std::optional<std::variant<nitro::NullType, NitroPreorderDetailsAndroid>> preorderDetailsAndroid SWIFT_PRIVATE;
68
68
  std::string priceAmountMicros SWIFT_PRIVATE;
69
69
  std::string priceCurrencyCode SWIFT_PRIVATE;
70
+ std::optional<std::variant<nitro::NullType, std::string>> purchaseOptionId SWIFT_PRIVATE;
70
71
  std::optional<std::variant<nitro::NullType, NitroRentalDetailsAndroid>> rentalDetailsAndroid SWIFT_PRIVATE;
71
72
  std::optional<std::variant<nitro::NullType, NitroValidTimeWindowAndroid>> validTimeWindow SWIFT_PRIVATE;
72
73
 
73
74
  public:
74
75
  NitroOneTimePurchaseOfferDetail() = default;
75
- explicit NitroOneTimePurchaseOfferDetail(std::optional<std::variant<nitro::NullType, NitroDiscountDisplayInfoAndroid>> discountDisplayInfo, std::string formattedPrice, std::optional<std::variant<nitro::NullType, std::string>> fullPriceMicros, std::optional<std::variant<nitro::NullType, NitroLimitedQuantityInfoAndroid>> limitedQuantityInfo, std::optional<std::variant<nitro::NullType, std::string>> offerId, std::vector<std::string> offerTags, std::string offerToken, std::optional<std::variant<nitro::NullType, NitroPreorderDetailsAndroid>> preorderDetailsAndroid, std::string priceAmountMicros, std::string priceCurrencyCode, std::optional<std::variant<nitro::NullType, NitroRentalDetailsAndroid>> rentalDetailsAndroid, std::optional<std::variant<nitro::NullType, NitroValidTimeWindowAndroid>> validTimeWindow): discountDisplayInfo(discountDisplayInfo), formattedPrice(formattedPrice), fullPriceMicros(fullPriceMicros), limitedQuantityInfo(limitedQuantityInfo), offerId(offerId), offerTags(offerTags), offerToken(offerToken), preorderDetailsAndroid(preorderDetailsAndroid), priceAmountMicros(priceAmountMicros), priceCurrencyCode(priceCurrencyCode), rentalDetailsAndroid(rentalDetailsAndroid), validTimeWindow(validTimeWindow) {}
76
+ explicit NitroOneTimePurchaseOfferDetail(std::optional<std::variant<nitro::NullType, NitroDiscountDisplayInfoAndroid>> discountDisplayInfo, std::string formattedPrice, std::optional<std::variant<nitro::NullType, std::string>> fullPriceMicros, std::optional<std::variant<nitro::NullType, NitroLimitedQuantityInfoAndroid>> limitedQuantityInfo, std::optional<std::variant<nitro::NullType, std::string>> offerId, std::vector<std::string> offerTags, std::string offerToken, std::optional<std::variant<nitro::NullType, NitroPreorderDetailsAndroid>> preorderDetailsAndroid, std::string priceAmountMicros, std::string priceCurrencyCode, std::optional<std::variant<nitro::NullType, std::string>> purchaseOptionId, std::optional<std::variant<nitro::NullType, NitroRentalDetailsAndroid>> rentalDetailsAndroid, std::optional<std::variant<nitro::NullType, NitroValidTimeWindowAndroid>> validTimeWindow): discountDisplayInfo(discountDisplayInfo), formattedPrice(formattedPrice), fullPriceMicros(fullPriceMicros), limitedQuantityInfo(limitedQuantityInfo), offerId(offerId), offerTags(offerTags), offerToken(offerToken), preorderDetailsAndroid(preorderDetailsAndroid), priceAmountMicros(priceAmountMicros), priceCurrencyCode(priceCurrencyCode), purchaseOptionId(purchaseOptionId), rentalDetailsAndroid(rentalDetailsAndroid), validTimeWindow(validTimeWindow) {}
76
77
 
77
78
  public:
78
79
  friend bool operator==(const NitroOneTimePurchaseOfferDetail& lhs, const NitroOneTimePurchaseOfferDetail& rhs) = default;
@@ -98,6 +99,7 @@ namespace margelo::nitro {
98
99
  JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::NitroPreorderDetailsAndroid>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "preorderDetailsAndroid"))),
99
100
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "priceAmountMicros"))),
100
101
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "priceCurrencyCode"))),
102
+ JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "purchaseOptionId"))),
101
103
  JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::NitroRentalDetailsAndroid>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "rentalDetailsAndroid"))),
102
104
  JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::NitroValidTimeWindowAndroid>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "validTimeWindow")))
103
105
  );
@@ -114,6 +116,7 @@ namespace margelo::nitro {
114
116
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "preorderDetailsAndroid"), JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::NitroPreorderDetailsAndroid>>>::toJSI(runtime, arg.preorderDetailsAndroid));
115
117
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "priceAmountMicros"), JSIConverter<std::string>::toJSI(runtime, arg.priceAmountMicros));
116
118
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "priceCurrencyCode"), JSIConverter<std::string>::toJSI(runtime, arg.priceCurrencyCode));
119
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "purchaseOptionId"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.purchaseOptionId));
117
120
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "rentalDetailsAndroid"), JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::NitroRentalDetailsAndroid>>>::toJSI(runtime, arg.rentalDetailsAndroid));
118
121
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "validTimeWindow"), JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::NitroValidTimeWindowAndroid>>>::toJSI(runtime, arg.validTimeWindow));
119
122
  return obj;
@@ -136,6 +139,7 @@ namespace margelo::nitro {
136
139
  if (!JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::NitroPreorderDetailsAndroid>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "preorderDetailsAndroid")))) return false;
137
140
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "priceAmountMicros")))) return false;
138
141
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "priceCurrencyCode")))) return false;
142
+ if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "purchaseOptionId")))) return false;
139
143
  if (!JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::NitroRentalDetailsAndroid>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "rentalDetailsAndroid")))) return false;
140
144
  if (!JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::NitroValidTimeWindowAndroid>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "validTimeWindow")))) return false;
141
145
  return true;