react-native-iap 14.5.1-rc.1 → 14.6.0-rc.2

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 (81) hide show
  1. package/README.md +1 -0
  2. package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +198 -36
  3. package/ios/HybridRnIap.swift +32 -2
  4. package/lib/module/hooks/useIAP.js +1 -6
  5. package/lib/module/hooks/useIAP.js.map +1 -1
  6. package/lib/module/index.js +228 -10
  7. package/lib/module/index.js.map +1 -1
  8. package/lib/module/types.js +116 -0
  9. package/lib/module/types.js.map +1 -1
  10. package/lib/typescript/plugin/src/withIAP.d.ts +6 -0
  11. package/lib/typescript/plugin/src/withIAP.d.ts.map +1 -1
  12. package/lib/typescript/src/hooks/useIAP.d.ts +5 -7
  13. package/lib/typescript/src/hooks/useIAP.d.ts.map +1 -1
  14. package/lib/typescript/src/index.d.ts +144 -2
  15. package/lib/typescript/src/index.d.ts.map +1 -1
  16. package/lib/typescript/src/specs/RnIap.nitro.d.ts +90 -8
  17. package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
  18. package/lib/typescript/src/types.d.ts +194 -10
  19. package/lib/typescript/src/types.d.ts.map +1 -1
  20. package/nitrogen/generated/android/c++/JBillingProgramAndroid.hpp +62 -0
  21. package/nitrogen/generated/android/c++/JExternalLinkLaunchModeAndroid.hpp +62 -0
  22. package/nitrogen/generated/android/c++/JExternalLinkTypeAndroid.hpp +62 -0
  23. package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +88 -4
  24. package/nitrogen/generated/android/c++/JHybridRnIapSpec.hpp +4 -0
  25. package/nitrogen/generated/android/c++/JNitroBillingProgramAvailabilityResultAndroid.hpp +62 -0
  26. package/nitrogen/generated/android/c++/JNitroBillingProgramReportingDetailsAndroid.hpp +63 -0
  27. package/nitrogen/generated/android/c++/JNitroLaunchExternalLinkParamsAndroid.hpp +75 -0
  28. package/nitrogen/generated/android/c++/JNitroReceiptValidationAppleOptions.hpp +57 -0
  29. package/nitrogen/generated/android/c++/{JNitroReceiptValidationAndroidOptions.hpp → JNitroReceiptValidationGoogleOptions.hpp} +18 -14
  30. package/nitrogen/generated/android/c++/JNitroReceiptValidationHorizonOptions.hpp +65 -0
  31. package/nitrogen/generated/android/c++/JNitroReceiptValidationParams.hpp +19 -11
  32. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/BillingProgramAndroid.kt +22 -0
  33. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/ExternalLinkLaunchModeAndroid.kt +22 -0
  34. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/ExternalLinkTypeAndroid.kt +22 -0
  35. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +16 -0
  36. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroBillingProgramAvailabilityResultAndroid.kt +39 -0
  37. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroBillingProgramReportingDetailsAndroid.kt +39 -0
  38. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroLaunchExternalLinkParamsAndroid.kt +45 -0
  39. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationAppleOptions.kt +36 -0
  40. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/{NitroReceiptValidationAndroidOptions.kt → NitroReceiptValidationGoogleOptions.kt} +9 -6
  41. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationHorizonOptions.kt +42 -0
  42. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationParams.kt +7 -4
  43. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.cpp +16 -0
  44. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +141 -10
  45. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +27 -3
  46. package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +57 -3
  47. package/nitrogen/generated/ios/swift/BillingProgramAndroid.swift +44 -0
  48. package/nitrogen/generated/ios/swift/ExternalLinkLaunchModeAndroid.swift +44 -0
  49. package/nitrogen/generated/ios/swift/ExternalLinkTypeAndroid.swift +44 -0
  50. package/nitrogen/generated/ios/swift/Func_void_NitroBillingProgramAvailabilityResultAndroid.swift +47 -0
  51. package/nitrogen/generated/ios/swift/Func_void_NitroBillingProgramReportingDetailsAndroid.swift +47 -0
  52. package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +4 -0
  53. package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +68 -0
  54. package/nitrogen/generated/ios/swift/NitroBillingProgramAvailabilityResultAndroid.swift +46 -0
  55. package/nitrogen/generated/ios/swift/NitroBillingProgramReportingDetailsAndroid.swift +46 -0
  56. package/nitrogen/generated/ios/swift/NitroLaunchExternalLinkParamsAndroid.swift +68 -0
  57. package/nitrogen/generated/ios/swift/NitroReceiptValidationAppleOptions.swift +35 -0
  58. package/nitrogen/generated/ios/swift/{NitroReceiptValidationAndroidOptions.swift → NitroReceiptValidationGoogleOptions.swift} +21 -10
  59. package/nitrogen/generated/ios/swift/NitroReceiptValidationHorizonOptions.swift +57 -0
  60. package/nitrogen/generated/ios/swift/NitroReceiptValidationParams.swift +46 -11
  61. package/nitrogen/generated/shared/c++/BillingProgramAndroid.hpp +80 -0
  62. package/nitrogen/generated/shared/c++/ExternalLinkLaunchModeAndroid.hpp +80 -0
  63. package/nitrogen/generated/shared/c++/ExternalLinkTypeAndroid.hpp +80 -0
  64. package/nitrogen/generated/shared/c++/HybridRnIapSpec.cpp +4 -0
  65. package/nitrogen/generated/shared/c++/HybridRnIapSpec.hpp +16 -0
  66. package/nitrogen/generated/shared/c++/NitroBillingProgramAvailabilityResultAndroid.hpp +80 -0
  67. package/nitrogen/generated/shared/c++/NitroBillingProgramReportingDetailsAndroid.hpp +81 -0
  68. package/nitrogen/generated/shared/c++/NitroLaunchExternalLinkParamsAndroid.hpp +95 -0
  69. package/nitrogen/generated/shared/c++/NitroReceiptValidationAppleOptions.hpp +75 -0
  70. package/nitrogen/generated/shared/c++/{NitroReceiptValidationAndroidOptions.hpp → NitroReceiptValidationGoogleOptions.hpp} +18 -14
  71. package/nitrogen/generated/shared/c++/NitroReceiptValidationHorizonOptions.hpp +83 -0
  72. package/nitrogen/generated/shared/c++/NitroReceiptValidationParams.hpp +22 -13
  73. package/openiap-versions.json +3 -3
  74. package/package.json +1 -1
  75. package/plugin/build/withIAP.d.ts +6 -0
  76. package/plugin/build/withIAP.js +46 -2
  77. package/plugin/src/withIAP.ts +67 -2
  78. package/src/hooks/useIAP.ts +8 -23
  79. package/src/index.ts +297 -14
  80. package/src/specs/RnIap.nitro.ts +125 -10
  81. package/src/types.ts +207 -10
@@ -0,0 +1,80 @@
1
+ ///
2
+ /// ExternalLinkTypeAndroid.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/NitroHash.hpp>)
11
+ #include <NitroModules/NitroHash.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
16
+ #include <NitroModules/JSIConverter.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
21
+ #include <NitroModules/NitroDefines.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+
26
+ namespace margelo::nitro::iap {
27
+
28
+ /**
29
+ * An enum which can be represented as a JavaScript union (ExternalLinkTypeAndroid).
30
+ */
31
+ enum class ExternalLinkTypeAndroid {
32
+ UNSPECIFIED SWIFT_NAME(unspecified) = 0,
33
+ LINK_TO_DIGITAL_CONTENT_OFFER SWIFT_NAME(linkToDigitalContentOffer) = 1,
34
+ LINK_TO_APP_DOWNLOAD SWIFT_NAME(linkToAppDownload) = 2,
35
+ } CLOSED_ENUM;
36
+
37
+ } // namespace margelo::nitro::iap
38
+
39
+ namespace margelo::nitro {
40
+
41
+ // C++ ExternalLinkTypeAndroid <> JS ExternalLinkTypeAndroid (union)
42
+ template <>
43
+ struct JSIConverter<margelo::nitro::iap::ExternalLinkTypeAndroid> final {
44
+ static inline margelo::nitro::iap::ExternalLinkTypeAndroid fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
45
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
46
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
47
+ case hashString("unspecified"): return margelo::nitro::iap::ExternalLinkTypeAndroid::UNSPECIFIED;
48
+ case hashString("link-to-digital-content-offer"): return margelo::nitro::iap::ExternalLinkTypeAndroid::LINK_TO_DIGITAL_CONTENT_OFFER;
49
+ case hashString("link-to-app-download"): return margelo::nitro::iap::ExternalLinkTypeAndroid::LINK_TO_APP_DOWNLOAD;
50
+ default: [[unlikely]]
51
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum ExternalLinkTypeAndroid - invalid value!");
52
+ }
53
+ }
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::iap::ExternalLinkTypeAndroid arg) {
55
+ switch (arg) {
56
+ case margelo::nitro::iap::ExternalLinkTypeAndroid::UNSPECIFIED: return JSIConverter<std::string>::toJSI(runtime, "unspecified");
57
+ case margelo::nitro::iap::ExternalLinkTypeAndroid::LINK_TO_DIGITAL_CONTENT_OFFER: return JSIConverter<std::string>::toJSI(runtime, "link-to-digital-content-offer");
58
+ case margelo::nitro::iap::ExternalLinkTypeAndroid::LINK_TO_APP_DOWNLOAD: return JSIConverter<std::string>::toJSI(runtime, "link-to-app-download");
59
+ default: [[unlikely]]
60
+ throw std::invalid_argument("Cannot convert ExternalLinkTypeAndroid to JS - invalid value: "
61
+ + std::to_string(static_cast<int>(arg)) + "!");
62
+ }
63
+ }
64
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
65
+ if (!value.isString()) {
66
+ return false;
67
+ }
68
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
69
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
70
+ case hashString("unspecified"):
71
+ case hashString("link-to-digital-content-offer"):
72
+ case hashString("link-to-app-download"):
73
+ return true;
74
+ default:
75
+ return false;
76
+ }
77
+ }
78
+ };
79
+
80
+ } // namespace margelo::nitro
@@ -58,6 +58,10 @@ namespace margelo::nitro::iap {
58
58
  prototype.registerHybridMethod("createAlternativeBillingTokenAndroid", &HybridRnIapSpec::createAlternativeBillingTokenAndroid);
59
59
  prototype.registerHybridMethod("addUserChoiceBillingListenerAndroid", &HybridRnIapSpec::addUserChoiceBillingListenerAndroid);
60
60
  prototype.registerHybridMethod("removeUserChoiceBillingListenerAndroid", &HybridRnIapSpec::removeUserChoiceBillingListenerAndroid);
61
+ prototype.registerHybridMethod("enableBillingProgramAndroid", &HybridRnIapSpec::enableBillingProgramAndroid);
62
+ prototype.registerHybridMethod("isBillingProgramAvailableAndroid", &HybridRnIapSpec::isBillingProgramAvailableAndroid);
63
+ prototype.registerHybridMethod("createBillingProgramReportingDetailsAndroid", &HybridRnIapSpec::createBillingProgramReportingDetailsAndroid);
64
+ prototype.registerHybridMethod("launchExternalLinkAndroid", &HybridRnIapSpec::launchExternalLinkAndroid);
61
65
  prototype.registerHybridMethod("canPresentExternalPurchaseNoticeIOS", &HybridRnIapSpec::canPresentExternalPurchaseNoticeIOS);
62
66
  prototype.registerHybridMethod("presentExternalPurchaseNoticeSheetIOS", &HybridRnIapSpec::presentExternalPurchaseNoticeSheetIOS);
63
67
  prototype.registerHybridMethod("presentExternalPurchaseLinkIOS", &HybridRnIapSpec::presentExternalPurchaseLinkIOS);
@@ -49,6 +49,14 @@ namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithProviderProps; }
49
49
  namespace margelo::nitro::iap { struct NitroDeepLinkOptionsAndroid; }
50
50
  // Forward declaration of `UserChoiceBillingDetails` to properly resolve imports.
51
51
  namespace margelo::nitro::iap { struct UserChoiceBillingDetails; }
52
+ // Forward declaration of `BillingProgramAndroid` to properly resolve imports.
53
+ namespace margelo::nitro::iap { enum class BillingProgramAndroid; }
54
+ // Forward declaration of `NitroBillingProgramAvailabilityResultAndroid` to properly resolve imports.
55
+ namespace margelo::nitro::iap { struct NitroBillingProgramAvailabilityResultAndroid; }
56
+ // Forward declaration of `NitroBillingProgramReportingDetailsAndroid` to properly resolve imports.
57
+ namespace margelo::nitro::iap { struct NitroBillingProgramReportingDetailsAndroid; }
58
+ // Forward declaration of `NitroLaunchExternalLinkParamsAndroid` to properly resolve imports.
59
+ namespace margelo::nitro::iap { struct NitroLaunchExternalLinkParamsAndroid; }
52
60
  // Forward declaration of `ExternalPurchaseNoticeResultIOS` to properly resolve imports.
53
61
  namespace margelo::nitro::iap { struct ExternalPurchaseNoticeResultIOS; }
54
62
  // Forward declaration of `ExternalPurchaseLinkResultIOS` to properly resolve imports.
@@ -78,6 +86,10 @@ namespace margelo::nitro::iap { struct ExternalPurchaseLinkResultIOS; }
78
86
  #include "NitroVerifyPurchaseWithProviderProps.hpp"
79
87
  #include "NitroDeepLinkOptionsAndroid.hpp"
80
88
  #include "UserChoiceBillingDetails.hpp"
89
+ #include "BillingProgramAndroid.hpp"
90
+ #include "NitroBillingProgramAvailabilityResultAndroid.hpp"
91
+ #include "NitroBillingProgramReportingDetailsAndroid.hpp"
92
+ #include "NitroLaunchExternalLinkParamsAndroid.hpp"
81
93
  #include "ExternalPurchaseNoticeResultIOS.hpp"
82
94
  #include "ExternalPurchaseLinkResultIOS.hpp"
83
95
 
@@ -156,6 +168,10 @@ namespace margelo::nitro::iap {
156
168
  virtual std::shared_ptr<Promise<std::optional<std::string>>> createAlternativeBillingTokenAndroid(const std::optional<std::string>& sku) = 0;
157
169
  virtual void addUserChoiceBillingListenerAndroid(const std::function<void(const UserChoiceBillingDetails& /* details */)>& listener) = 0;
158
170
  virtual void removeUserChoiceBillingListenerAndroid(const std::function<void(const UserChoiceBillingDetails& /* details */)>& listener) = 0;
171
+ virtual void enableBillingProgramAndroid(BillingProgramAndroid program) = 0;
172
+ virtual std::shared_ptr<Promise<NitroBillingProgramAvailabilityResultAndroid>> isBillingProgramAvailableAndroid(BillingProgramAndroid program) = 0;
173
+ virtual std::shared_ptr<Promise<NitroBillingProgramReportingDetailsAndroid>> createBillingProgramReportingDetailsAndroid(BillingProgramAndroid program) = 0;
174
+ virtual std::shared_ptr<Promise<bool>> launchExternalLinkAndroid(const NitroLaunchExternalLinkParamsAndroid& params) = 0;
159
175
  virtual std::shared_ptr<Promise<bool>> canPresentExternalPurchaseNoticeIOS() = 0;
160
176
  virtual std::shared_ptr<Promise<ExternalPurchaseNoticeResultIOS>> presentExternalPurchaseNoticeSheetIOS() = 0;
161
177
  virtual std::shared_ptr<Promise<ExternalPurchaseLinkResultIOS>> presentExternalPurchaseLinkIOS(const std::string& url) = 0;
@@ -0,0 +1,80 @@
1
+ ///
2
+ /// NitroBillingProgramAvailabilityResultAndroid.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 `BillingProgramAndroid` to properly resolve imports.
27
+ namespace margelo::nitro::iap { enum class BillingProgramAndroid; }
28
+
29
+ #include "BillingProgramAndroid.hpp"
30
+
31
+ namespace margelo::nitro::iap {
32
+
33
+ /**
34
+ * A struct which can be represented as a JavaScript object (NitroBillingProgramAvailabilityResultAndroid).
35
+ */
36
+ struct NitroBillingProgramAvailabilityResultAndroid {
37
+ public:
38
+ BillingProgramAndroid billingProgram SWIFT_PRIVATE;
39
+ bool isAvailable SWIFT_PRIVATE;
40
+
41
+ public:
42
+ NitroBillingProgramAvailabilityResultAndroid() = default;
43
+ explicit NitroBillingProgramAvailabilityResultAndroid(BillingProgramAndroid billingProgram, bool isAvailable): billingProgram(billingProgram), isAvailable(isAvailable) {}
44
+ };
45
+
46
+ } // namespace margelo::nitro::iap
47
+
48
+ namespace margelo::nitro {
49
+
50
+ // C++ NitroBillingProgramAvailabilityResultAndroid <> JS NitroBillingProgramAvailabilityResultAndroid (object)
51
+ template <>
52
+ struct JSIConverter<margelo::nitro::iap::NitroBillingProgramAvailabilityResultAndroid> final {
53
+ static inline margelo::nitro::iap::NitroBillingProgramAvailabilityResultAndroid fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
54
+ jsi::Object obj = arg.asObject(runtime);
55
+ return margelo::nitro::iap::NitroBillingProgramAvailabilityResultAndroid(
56
+ JSIConverter<margelo::nitro::iap::BillingProgramAndroid>::fromJSI(runtime, obj.getProperty(runtime, "billingProgram")),
57
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "isAvailable"))
58
+ );
59
+ }
60
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroBillingProgramAvailabilityResultAndroid& arg) {
61
+ jsi::Object obj(runtime);
62
+ obj.setProperty(runtime, "billingProgram", JSIConverter<margelo::nitro::iap::BillingProgramAndroid>::toJSI(runtime, arg.billingProgram));
63
+ obj.setProperty(runtime, "isAvailable", JSIConverter<bool>::toJSI(runtime, arg.isAvailable));
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<margelo::nitro::iap::BillingProgramAndroid>::canConvert(runtime, obj.getProperty(runtime, "billingProgram"))) return false;
75
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "isAvailable"))) return false;
76
+ return true;
77
+ }
78
+ };
79
+
80
+ } // namespace margelo::nitro
@@ -0,0 +1,81 @@
1
+ ///
2
+ /// NitroBillingProgramReportingDetailsAndroid.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 `BillingProgramAndroid` to properly resolve imports.
27
+ namespace margelo::nitro::iap { enum class BillingProgramAndroid; }
28
+
29
+ #include "BillingProgramAndroid.hpp"
30
+ #include <string>
31
+
32
+ namespace margelo::nitro::iap {
33
+
34
+ /**
35
+ * A struct which can be represented as a JavaScript object (NitroBillingProgramReportingDetailsAndroid).
36
+ */
37
+ struct NitroBillingProgramReportingDetailsAndroid {
38
+ public:
39
+ BillingProgramAndroid billingProgram SWIFT_PRIVATE;
40
+ std::string externalTransactionToken SWIFT_PRIVATE;
41
+
42
+ public:
43
+ NitroBillingProgramReportingDetailsAndroid() = default;
44
+ explicit NitroBillingProgramReportingDetailsAndroid(BillingProgramAndroid billingProgram, std::string externalTransactionToken): billingProgram(billingProgram), externalTransactionToken(externalTransactionToken) {}
45
+ };
46
+
47
+ } // namespace margelo::nitro::iap
48
+
49
+ namespace margelo::nitro {
50
+
51
+ // C++ NitroBillingProgramReportingDetailsAndroid <> JS NitroBillingProgramReportingDetailsAndroid (object)
52
+ template <>
53
+ struct JSIConverter<margelo::nitro::iap::NitroBillingProgramReportingDetailsAndroid> final {
54
+ static inline margelo::nitro::iap::NitroBillingProgramReportingDetailsAndroid fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
55
+ jsi::Object obj = arg.asObject(runtime);
56
+ return margelo::nitro::iap::NitroBillingProgramReportingDetailsAndroid(
57
+ JSIConverter<margelo::nitro::iap::BillingProgramAndroid>::fromJSI(runtime, obj.getProperty(runtime, "billingProgram")),
58
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "externalTransactionToken"))
59
+ );
60
+ }
61
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroBillingProgramReportingDetailsAndroid& arg) {
62
+ jsi::Object obj(runtime);
63
+ obj.setProperty(runtime, "billingProgram", JSIConverter<margelo::nitro::iap::BillingProgramAndroid>::toJSI(runtime, arg.billingProgram));
64
+ obj.setProperty(runtime, "externalTransactionToken", JSIConverter<std::string>::toJSI(runtime, arg.externalTransactionToken));
65
+ return obj;
66
+ }
67
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
68
+ if (!value.isObject()) {
69
+ return false;
70
+ }
71
+ jsi::Object obj = value.getObject(runtime);
72
+ if (!nitro::isPlainObject(runtime, obj)) {
73
+ return false;
74
+ }
75
+ if (!JSIConverter<margelo::nitro::iap::BillingProgramAndroid>::canConvert(runtime, obj.getProperty(runtime, "billingProgram"))) return false;
76
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "externalTransactionToken"))) return false;
77
+ return true;
78
+ }
79
+ };
80
+
81
+ } // namespace margelo::nitro
@@ -0,0 +1,95 @@
1
+ ///
2
+ /// NitroLaunchExternalLinkParamsAndroid.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 `BillingProgramAndroid` to properly resolve imports.
27
+ namespace margelo::nitro::iap { enum class BillingProgramAndroid; }
28
+ // Forward declaration of `ExternalLinkLaunchModeAndroid` to properly resolve imports.
29
+ namespace margelo::nitro::iap { enum class ExternalLinkLaunchModeAndroid; }
30
+ // Forward declaration of `ExternalLinkTypeAndroid` to properly resolve imports.
31
+ namespace margelo::nitro::iap { enum class ExternalLinkTypeAndroid; }
32
+
33
+ #include "BillingProgramAndroid.hpp"
34
+ #include "ExternalLinkLaunchModeAndroid.hpp"
35
+ #include "ExternalLinkTypeAndroid.hpp"
36
+ #include <string>
37
+
38
+ namespace margelo::nitro::iap {
39
+
40
+ /**
41
+ * A struct which can be represented as a JavaScript object (NitroLaunchExternalLinkParamsAndroid).
42
+ */
43
+ struct NitroLaunchExternalLinkParamsAndroid {
44
+ public:
45
+ BillingProgramAndroid billingProgram SWIFT_PRIVATE;
46
+ ExternalLinkLaunchModeAndroid launchMode SWIFT_PRIVATE;
47
+ ExternalLinkTypeAndroid linkType SWIFT_PRIVATE;
48
+ std::string linkUri SWIFT_PRIVATE;
49
+
50
+ public:
51
+ NitroLaunchExternalLinkParamsAndroid() = default;
52
+ explicit NitroLaunchExternalLinkParamsAndroid(BillingProgramAndroid billingProgram, ExternalLinkLaunchModeAndroid launchMode, ExternalLinkTypeAndroid linkType, std::string linkUri): billingProgram(billingProgram), launchMode(launchMode), linkType(linkType), linkUri(linkUri) {}
53
+ };
54
+
55
+ } // namespace margelo::nitro::iap
56
+
57
+ namespace margelo::nitro {
58
+
59
+ // C++ NitroLaunchExternalLinkParamsAndroid <> JS NitroLaunchExternalLinkParamsAndroid (object)
60
+ template <>
61
+ struct JSIConverter<margelo::nitro::iap::NitroLaunchExternalLinkParamsAndroid> final {
62
+ static inline margelo::nitro::iap::NitroLaunchExternalLinkParamsAndroid fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
63
+ jsi::Object obj = arg.asObject(runtime);
64
+ return margelo::nitro::iap::NitroLaunchExternalLinkParamsAndroid(
65
+ JSIConverter<margelo::nitro::iap::BillingProgramAndroid>::fromJSI(runtime, obj.getProperty(runtime, "billingProgram")),
66
+ JSIConverter<margelo::nitro::iap::ExternalLinkLaunchModeAndroid>::fromJSI(runtime, obj.getProperty(runtime, "launchMode")),
67
+ JSIConverter<margelo::nitro::iap::ExternalLinkTypeAndroid>::fromJSI(runtime, obj.getProperty(runtime, "linkType")),
68
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "linkUri"))
69
+ );
70
+ }
71
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroLaunchExternalLinkParamsAndroid& arg) {
72
+ jsi::Object obj(runtime);
73
+ obj.setProperty(runtime, "billingProgram", JSIConverter<margelo::nitro::iap::BillingProgramAndroid>::toJSI(runtime, arg.billingProgram));
74
+ obj.setProperty(runtime, "launchMode", JSIConverter<margelo::nitro::iap::ExternalLinkLaunchModeAndroid>::toJSI(runtime, arg.launchMode));
75
+ obj.setProperty(runtime, "linkType", JSIConverter<margelo::nitro::iap::ExternalLinkTypeAndroid>::toJSI(runtime, arg.linkType));
76
+ obj.setProperty(runtime, "linkUri", JSIConverter<std::string>::toJSI(runtime, arg.linkUri));
77
+ return obj;
78
+ }
79
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
80
+ if (!value.isObject()) {
81
+ return false;
82
+ }
83
+ jsi::Object obj = value.getObject(runtime);
84
+ if (!nitro::isPlainObject(runtime, obj)) {
85
+ return false;
86
+ }
87
+ if (!JSIConverter<margelo::nitro::iap::BillingProgramAndroid>::canConvert(runtime, obj.getProperty(runtime, "billingProgram"))) return false;
88
+ if (!JSIConverter<margelo::nitro::iap::ExternalLinkLaunchModeAndroid>::canConvert(runtime, obj.getProperty(runtime, "launchMode"))) return false;
89
+ if (!JSIConverter<margelo::nitro::iap::ExternalLinkTypeAndroid>::canConvert(runtime, obj.getProperty(runtime, "linkType"))) return false;
90
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "linkUri"))) return false;
91
+ return true;
92
+ }
93
+ };
94
+
95
+ } // namespace margelo::nitro
@@ -0,0 +1,75 @@
1
+ ///
2
+ /// NitroReceiptValidationAppleOptions.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 (NitroReceiptValidationAppleOptions).
34
+ */
35
+ struct NitroReceiptValidationAppleOptions {
36
+ public:
37
+ std::string sku SWIFT_PRIVATE;
38
+
39
+ public:
40
+ NitroReceiptValidationAppleOptions() = default;
41
+ explicit NitroReceiptValidationAppleOptions(std::string sku): sku(sku) {}
42
+ };
43
+
44
+ } // namespace margelo::nitro::iap
45
+
46
+ namespace margelo::nitro {
47
+
48
+ // C++ NitroReceiptValidationAppleOptions <> JS NitroReceiptValidationAppleOptions (object)
49
+ template <>
50
+ struct JSIConverter<margelo::nitro::iap::NitroReceiptValidationAppleOptions> final {
51
+ static inline margelo::nitro::iap::NitroReceiptValidationAppleOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
52
+ jsi::Object obj = arg.asObject(runtime);
53
+ return margelo::nitro::iap::NitroReceiptValidationAppleOptions(
54
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "sku"))
55
+ );
56
+ }
57
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroReceiptValidationAppleOptions& arg) {
58
+ jsi::Object obj(runtime);
59
+ obj.setProperty(runtime, "sku", JSIConverter<std::string>::toJSI(runtime, arg.sku));
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, "sku"))) return false;
71
+ return true;
72
+ }
73
+ };
74
+
75
+ } // namespace margelo::nitro
@@ -1,5 +1,5 @@
1
1
  ///
2
- /// NitroReceiptValidationAndroidOptions.hpp
2
+ /// NitroReceiptValidationGoogleOptions.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
5
  /// Copyright © 2025 Marc Rousavy @ Margelo
@@ -31,42 +31,45 @@
31
31
  namespace margelo::nitro::iap {
32
32
 
33
33
  /**
34
- * A struct which can be represented as a JavaScript object (NitroReceiptValidationAndroidOptions).
34
+ * A struct which can be represented as a JavaScript object (NitroReceiptValidationGoogleOptions).
35
35
  */
36
- struct NitroReceiptValidationAndroidOptions {
36
+ struct NitroReceiptValidationGoogleOptions {
37
37
  public:
38
38
  std::string accessToken SWIFT_PRIVATE;
39
39
  std::optional<bool> isSub SWIFT_PRIVATE;
40
40
  std::string packageName SWIFT_PRIVATE;
41
- std::string productToken SWIFT_PRIVATE;
41
+ std::string purchaseToken SWIFT_PRIVATE;
42
+ std::string sku SWIFT_PRIVATE;
42
43
 
43
44
  public:
44
- NitroReceiptValidationAndroidOptions() = default;
45
- explicit NitroReceiptValidationAndroidOptions(std::string accessToken, std::optional<bool> isSub, std::string packageName, std::string productToken): accessToken(accessToken), isSub(isSub), packageName(packageName), productToken(productToken) {}
45
+ NitroReceiptValidationGoogleOptions() = default;
46
+ explicit NitroReceiptValidationGoogleOptions(std::string accessToken, std::optional<bool> isSub, std::string packageName, std::string purchaseToken, std::string sku): accessToken(accessToken), isSub(isSub), packageName(packageName), purchaseToken(purchaseToken), sku(sku) {}
46
47
  };
47
48
 
48
49
  } // namespace margelo::nitro::iap
49
50
 
50
51
  namespace margelo::nitro {
51
52
 
52
- // C++ NitroReceiptValidationAndroidOptions <> JS NitroReceiptValidationAndroidOptions (object)
53
+ // C++ NitroReceiptValidationGoogleOptions <> JS NitroReceiptValidationGoogleOptions (object)
53
54
  template <>
54
- struct JSIConverter<margelo::nitro::iap::NitroReceiptValidationAndroidOptions> final {
55
- static inline margelo::nitro::iap::NitroReceiptValidationAndroidOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
55
+ struct JSIConverter<margelo::nitro::iap::NitroReceiptValidationGoogleOptions> final {
56
+ static inline margelo::nitro::iap::NitroReceiptValidationGoogleOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
56
57
  jsi::Object obj = arg.asObject(runtime);
57
- return margelo::nitro::iap::NitroReceiptValidationAndroidOptions(
58
+ return margelo::nitro::iap::NitroReceiptValidationGoogleOptions(
58
59
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "accessToken")),
59
60
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isSub")),
60
61
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "packageName")),
61
- JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "productToken"))
62
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "purchaseToken")),
63
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "sku"))
62
64
  );
63
65
  }
64
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroReceiptValidationAndroidOptions& arg) {
66
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroReceiptValidationGoogleOptions& arg) {
65
67
  jsi::Object obj(runtime);
66
68
  obj.setProperty(runtime, "accessToken", JSIConverter<std::string>::toJSI(runtime, arg.accessToken));
67
69
  obj.setProperty(runtime, "isSub", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isSub));
68
70
  obj.setProperty(runtime, "packageName", JSIConverter<std::string>::toJSI(runtime, arg.packageName));
69
- obj.setProperty(runtime, "productToken", JSIConverter<std::string>::toJSI(runtime, arg.productToken));
71
+ obj.setProperty(runtime, "purchaseToken", JSIConverter<std::string>::toJSI(runtime, arg.purchaseToken));
72
+ obj.setProperty(runtime, "sku", JSIConverter<std::string>::toJSI(runtime, arg.sku));
70
73
  return obj;
71
74
  }
72
75
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -80,7 +83,8 @@ namespace margelo::nitro {
80
83
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "accessToken"))) return false;
81
84
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isSub"))) return false;
82
85
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "packageName"))) return false;
83
- if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "productToken"))) return false;
86
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "purchaseToken"))) return false;
87
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "sku"))) return false;
84
88
  return true;
85
89
  }
86
90
  };
@@ -0,0 +1,83 @@
1
+ ///
2
+ /// NitroReceiptValidationHorizonOptions.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 (NitroReceiptValidationHorizonOptions).
34
+ */
35
+ struct NitroReceiptValidationHorizonOptions {
36
+ public:
37
+ std::string accessToken SWIFT_PRIVATE;
38
+ std::string sku SWIFT_PRIVATE;
39
+ std::string userId SWIFT_PRIVATE;
40
+
41
+ public:
42
+ NitroReceiptValidationHorizonOptions() = default;
43
+ explicit NitroReceiptValidationHorizonOptions(std::string accessToken, std::string sku, std::string userId): accessToken(accessToken), sku(sku), userId(userId) {}
44
+ };
45
+
46
+ } // namespace margelo::nitro::iap
47
+
48
+ namespace margelo::nitro {
49
+
50
+ // C++ NitroReceiptValidationHorizonOptions <> JS NitroReceiptValidationHorizonOptions (object)
51
+ template <>
52
+ struct JSIConverter<margelo::nitro::iap::NitroReceiptValidationHorizonOptions> final {
53
+ static inline margelo::nitro::iap::NitroReceiptValidationHorizonOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
54
+ jsi::Object obj = arg.asObject(runtime);
55
+ return margelo::nitro::iap::NitroReceiptValidationHorizonOptions(
56
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "accessToken")),
57
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "sku")),
58
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "userId"))
59
+ );
60
+ }
61
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroReceiptValidationHorizonOptions& arg) {
62
+ jsi::Object obj(runtime);
63
+ obj.setProperty(runtime, "accessToken", JSIConverter<std::string>::toJSI(runtime, arg.accessToken));
64
+ obj.setProperty(runtime, "sku", JSIConverter<std::string>::toJSI(runtime, arg.sku));
65
+ obj.setProperty(runtime, "userId", JSIConverter<std::string>::toJSI(runtime, arg.userId));
66
+ return obj;
67
+ }
68
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
69
+ if (!value.isObject()) {
70
+ return false;
71
+ }
72
+ jsi::Object obj = value.getObject(runtime);
73
+ if (!nitro::isPlainObject(runtime, obj)) {
74
+ return false;
75
+ }
76
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "accessToken"))) return false;
77
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "sku"))) return false;
78
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "userId"))) return false;
79
+ return true;
80
+ }
81
+ };
82
+
83
+ } // namespace margelo::nitro