react-native-iap 14.4.46 → 14.4.47

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 (75) hide show
  1. package/NitroIap.podspec +2 -2
  2. package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +113 -3
  3. package/ios/HybridRnIap.swift +61 -2
  4. package/lib/module/hooks/useIAP.js +9 -1
  5. package/lib/module/hooks/useIAP.js.map +1 -1
  6. package/lib/module/index.js +68 -1
  7. package/lib/module/index.js.map +1 -1
  8. package/lib/module/types.js +5 -0
  9. package/lib/module/types.js.map +1 -1
  10. package/lib/module/utils/errorMapping.js +32 -6
  11. package/lib/module/utils/errorMapping.js.map +1 -1
  12. package/lib/typescript/src/hooks/useIAP.d.ts +5 -1
  13. package/lib/typescript/src/hooks/useIAP.d.ts.map +1 -1
  14. package/lib/typescript/src/index.d.ts +34 -1
  15. package/lib/typescript/src/index.d.ts.map +1 -1
  16. package/lib/typescript/src/specs/RnIap.nitro.d.ts +72 -26
  17. package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
  18. package/lib/typescript/src/types.d.ts +109 -51
  19. package/lib/typescript/src/types.d.ts.map +1 -1
  20. package/lib/typescript/src/utils/errorMapping.d.ts.map +1 -1
  21. package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +76 -0
  22. package/nitrogen/generated/android/c++/JHybridRnIapSpec.hpp +2 -0
  23. package/nitrogen/generated/android/c++/JIapkitPurchaseState.hpp +80 -0
  24. package/nitrogen/generated/android/c++/JIapkitStore.hpp +59 -0
  25. package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithIapkitAppleProps.hpp +57 -0
  26. package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithIapkitGoogleProps.hpp +57 -0
  27. package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithIapkitProps.hpp +70 -0
  28. package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithIapkitResult.hpp +68 -0
  29. package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithProviderProps.hpp +70 -0
  30. package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithProviderResult.hpp +86 -0
  31. package/nitrogen/generated/android/c++/JPurchaseVerificationProvider.hpp +59 -0
  32. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +8 -0
  33. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/IapkitPurchaseState.kt +28 -0
  34. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/IapkitStore.kt +21 -0
  35. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithIapkitAppleProps.kt +36 -0
  36. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithIapkitGoogleProps.kt +36 -0
  37. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithIapkitProps.kt +42 -0
  38. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithIapkitResult.kt +42 -0
  39. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithProviderProps.kt +39 -0
  40. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithProviderResult.kt +39 -0
  41. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseVerificationProvider.kt +21 -0
  42. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.cpp +8 -0
  43. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +123 -0
  44. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +27 -0
  45. package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +43 -0
  46. package/nitrogen/generated/ios/swift/Func_void_NitroVerifyPurchaseWithProviderResult.swift +47 -0
  47. package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +2 -0
  48. package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +45 -0
  49. package/nitrogen/generated/ios/swift/IapkitPurchaseState.swift +68 -0
  50. package/nitrogen/generated/ios/swift/IapkitStore.swift +40 -0
  51. package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithIapkitAppleProps.swift +35 -0
  52. package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithIapkitGoogleProps.swift +35 -0
  53. package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithIapkitProps.swift +100 -0
  54. package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithIapkitResult.swift +57 -0
  55. package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithProviderProps.swift +58 -0
  56. package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithProviderResult.swift +58 -0
  57. package/nitrogen/generated/ios/swift/PurchaseVerificationProvider.swift +40 -0
  58. package/nitrogen/generated/shared/c++/HybridRnIapSpec.cpp +2 -0
  59. package/nitrogen/generated/shared/c++/HybridRnIapSpec.hpp +8 -0
  60. package/nitrogen/generated/shared/c++/IapkitPurchaseState.hpp +104 -0
  61. package/nitrogen/generated/shared/c++/IapkitStore.hpp +76 -0
  62. package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithIapkitAppleProps.hpp +75 -0
  63. package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithIapkitGoogleProps.hpp +75 -0
  64. package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithIapkitProps.hpp +89 -0
  65. package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithIapkitResult.hpp +87 -0
  66. package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithProviderProps.hpp +84 -0
  67. package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithProviderResult.hpp +84 -0
  68. package/nitrogen/generated/shared/c++/PurchaseVerificationProvider.hpp +76 -0
  69. package/openiap-versions.json +3 -3
  70. package/package.json +1 -1
  71. package/src/hooks/useIAP.ts +32 -0
  72. package/src/index.ts +74 -5
  73. package/src/specs/RnIap.nitro.ts +101 -28
  74. package/src/types.ts +126 -57
  75. package/src/utils/errorMapping.ts +32 -4
@@ -0,0 +1,86 @@
1
+ ///
2
+ /// JNitroVerifyPurchaseWithProviderResult.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
+ #include <fbjni/fbjni.h>
11
+ #include "NitroVerifyPurchaseWithProviderResult.hpp"
12
+
13
+ #include "IapkitPurchaseState.hpp"
14
+ #include "IapkitStore.hpp"
15
+ #include "JIapkitPurchaseState.hpp"
16
+ #include "JIapkitStore.hpp"
17
+ #include "JNitroVerifyPurchaseWithIapkitResult.hpp"
18
+ #include "JPurchaseVerificationProvider.hpp"
19
+ #include "NitroVerifyPurchaseWithIapkitResult.hpp"
20
+ #include "PurchaseVerificationProvider.hpp"
21
+ #include <vector>
22
+
23
+ namespace margelo::nitro::iap {
24
+
25
+ using namespace facebook;
26
+
27
+ /**
28
+ * The C++ JNI bridge between the C++ struct "NitroVerifyPurchaseWithProviderResult" and the the Kotlin data class "NitroVerifyPurchaseWithProviderResult".
29
+ */
30
+ struct JNitroVerifyPurchaseWithProviderResult final: public jni::JavaClass<JNitroVerifyPurchaseWithProviderResult> {
31
+ public:
32
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/NitroVerifyPurchaseWithProviderResult;";
33
+
34
+ public:
35
+ /**
36
+ * Convert this Java/Kotlin-based struct to the C++ struct NitroVerifyPurchaseWithProviderResult by copying all values to C++.
37
+ */
38
+ [[maybe_unused]]
39
+ [[nodiscard]]
40
+ NitroVerifyPurchaseWithProviderResult toCpp() const {
41
+ static const auto clazz = javaClassStatic();
42
+ static const auto fieldIapkit = clazz->getField<jni::JArrayClass<JNitroVerifyPurchaseWithIapkitResult>>("iapkit");
43
+ jni::local_ref<jni::JArrayClass<JNitroVerifyPurchaseWithIapkitResult>> iapkit = this->getFieldValue(fieldIapkit);
44
+ static const auto fieldProvider = clazz->getField<JPurchaseVerificationProvider>("provider");
45
+ jni::local_ref<JPurchaseVerificationProvider> provider = this->getFieldValue(fieldProvider);
46
+ return NitroVerifyPurchaseWithProviderResult(
47
+ [&]() {
48
+ size_t __size = iapkit->size();
49
+ std::vector<NitroVerifyPurchaseWithIapkitResult> __vector;
50
+ __vector.reserve(__size);
51
+ for (size_t __i = 0; __i < __size; __i++) {
52
+ auto __element = iapkit->getElement(__i);
53
+ __vector.push_back(__element->toCpp());
54
+ }
55
+ return __vector;
56
+ }(),
57
+ provider->toCpp()
58
+ );
59
+ }
60
+
61
+ public:
62
+ /**
63
+ * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
64
+ */
65
+ [[maybe_unused]]
66
+ static jni::local_ref<JNitroVerifyPurchaseWithProviderResult::javaobject> fromCpp(const NitroVerifyPurchaseWithProviderResult& value) {
67
+ using JSignature = JNitroVerifyPurchaseWithProviderResult(jni::alias_ref<jni::JArrayClass<JNitroVerifyPurchaseWithIapkitResult>>, jni::alias_ref<JPurchaseVerificationProvider>);
68
+ static const auto clazz = javaClassStatic();
69
+ static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
70
+ return create(
71
+ clazz,
72
+ [&]() {
73
+ size_t __size = value.iapkit.size();
74
+ jni::local_ref<jni::JArrayClass<JNitroVerifyPurchaseWithIapkitResult>> __array = jni::JArrayClass<JNitroVerifyPurchaseWithIapkitResult>::newArray(__size);
75
+ for (size_t __i = 0; __i < __size; __i++) {
76
+ const auto& __element = value.iapkit[__i];
77
+ __array->setElement(__i, *JNitroVerifyPurchaseWithIapkitResult::fromCpp(__element));
78
+ }
79
+ return __array;
80
+ }(),
81
+ JPurchaseVerificationProvider::fromCpp(value.provider)
82
+ );
83
+ }
84
+ };
85
+
86
+ } // namespace margelo::nitro::iap
@@ -0,0 +1,59 @@
1
+ ///
2
+ /// JPurchaseVerificationProvider.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
+ #include <fbjni/fbjni.h>
11
+ #include "PurchaseVerificationProvider.hpp"
12
+
13
+ namespace margelo::nitro::iap {
14
+
15
+ using namespace facebook;
16
+
17
+ /**
18
+ * The C++ JNI bridge between the C++ enum "PurchaseVerificationProvider" and the the Kotlin enum "PurchaseVerificationProvider".
19
+ */
20
+ struct JPurchaseVerificationProvider final: public jni::JavaClass<JPurchaseVerificationProvider> {
21
+ public:
22
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/PurchaseVerificationProvider;";
23
+
24
+ public:
25
+ /**
26
+ * Convert this Java/Kotlin-based enum to the C++ enum PurchaseVerificationProvider.
27
+ */
28
+ [[maybe_unused]]
29
+ [[nodiscard]]
30
+ PurchaseVerificationProvider toCpp() const {
31
+ static const auto clazz = javaClassStatic();
32
+ static const auto fieldOrdinal = clazz->getField<int>("value");
33
+ int ordinal = this->getFieldValue(fieldOrdinal);
34
+ return static_cast<PurchaseVerificationProvider>(ordinal);
35
+ }
36
+
37
+ public:
38
+ /**
39
+ * Create a Java/Kotlin-based enum with the given C++ enum's value.
40
+ */
41
+ [[maybe_unused]]
42
+ static jni::alias_ref<JPurchaseVerificationProvider> fromCpp(PurchaseVerificationProvider value) {
43
+ static const auto clazz = javaClassStatic();
44
+ static const auto fieldNONE = clazz->getStaticField<JPurchaseVerificationProvider>("NONE");
45
+ static const auto fieldIAPKIT = clazz->getStaticField<JPurchaseVerificationProvider>("IAPKIT");
46
+
47
+ switch (value) {
48
+ case PurchaseVerificationProvider::NONE:
49
+ return clazz->getStaticFieldValue(fieldNONE);
50
+ case PurchaseVerificationProvider::IAPKIT:
51
+ return clazz->getStaticFieldValue(fieldIAPKIT);
52
+ default:
53
+ std::string stringValue = std::to_string(static_cast<int>(value));
54
+ throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
55
+ }
56
+ }
57
+ };
58
+
59
+ } // namespace margelo::nitro::iap
@@ -65,6 +65,10 @@ abstract class HybridRnIapSpec: HybridObject() {
65
65
  @Keep
66
66
  abstract fun getActiveSubscriptions(subscriptionIds: Array<String>?): Promise<Array<NitroActiveSubscription>>
67
67
 
68
+ @DoNotStrip
69
+ @Keep
70
+ abstract fun hasActiveSubscriptions(subscriptionIds: Array<String>?): Promise<Boolean>
71
+
68
72
  @DoNotStrip
69
73
  @Keep
70
74
  abstract fun finishTransaction(params: NitroFinishTransactionParams): Promise<Variant_Boolean_NitroPurchaseResult>
@@ -211,6 +215,10 @@ abstract class HybridRnIapSpec: HybridObject() {
211
215
  @Keep
212
216
  abstract fun validateReceipt(params: NitroReceiptValidationParams): Promise<Variant_NitroReceiptValidationResultIOS_NitroReceiptValidationResultAndroid>
213
217
 
218
+ @DoNotStrip
219
+ @Keep
220
+ abstract fun verifyPurchaseWithProvider(params: NitroVerifyPurchaseWithProviderProps): Promise<NitroVerifyPurchaseWithProviderResult>
221
+
214
222
  @DoNotStrip
215
223
  @Keep
216
224
  abstract fun getStorefront(): Promise<String>
@@ -0,0 +1,28 @@
1
+ ///
2
+ /// IapkitPurchaseState.kt
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
+ package com.margelo.nitro.iap
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+ /**
14
+ * Represents the JavaScript enum/union "IapkitPurchaseState".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class IapkitPurchaseState(@DoNotStrip @Keep val value: Int) {
19
+ PENDING(0),
20
+ UNKNOWN(1),
21
+ ENTITLED(2),
22
+ PENDING_ACKNOWLEDGMENT(3),
23
+ CANCELED(4),
24
+ EXPIRED(5),
25
+ READY_TO_CONSUME(6),
26
+ CONSUMED(7),
27
+ INAUTHENTIC(8);
28
+ }
@@ -0,0 +1,21 @@
1
+ ///
2
+ /// IapkitStore.kt
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
+ package com.margelo.nitro.iap
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+ /**
14
+ * Represents the JavaScript enum/union "IapkitStore".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class IapkitStore(@DoNotStrip @Keep val value: Int) {
19
+ APPLE(0),
20
+ GOOGLE(1);
21
+ }
@@ -0,0 +1,36 @@
1
+ ///
2
+ /// NitroVerifyPurchaseWithIapkitAppleProps.kt
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
+ package com.margelo.nitro.iap
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "NitroVerifyPurchaseWithIapkitAppleProps".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class NitroVerifyPurchaseWithIapkitAppleProps(
20
+ @DoNotStrip
21
+ @Keep
22
+ val jws: String
23
+ ) {
24
+ private companion object {
25
+ /**
26
+ * Constructor called from C++
27
+ */
28
+ @DoNotStrip
29
+ @Keep
30
+ @Suppress("unused")
31
+ @JvmStatic
32
+ private fun fromCpp(jws: String): NitroVerifyPurchaseWithIapkitAppleProps {
33
+ return NitroVerifyPurchaseWithIapkitAppleProps(jws)
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,36 @@
1
+ ///
2
+ /// NitroVerifyPurchaseWithIapkitGoogleProps.kt
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
+ package com.margelo.nitro.iap
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "NitroVerifyPurchaseWithIapkitGoogleProps".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class NitroVerifyPurchaseWithIapkitGoogleProps(
20
+ @DoNotStrip
21
+ @Keep
22
+ val purchaseToken: String
23
+ ) {
24
+ private companion object {
25
+ /**
26
+ * Constructor called from C++
27
+ */
28
+ @DoNotStrip
29
+ @Keep
30
+ @Suppress("unused")
31
+ @JvmStatic
32
+ private fun fromCpp(purchaseToken: String): NitroVerifyPurchaseWithIapkitGoogleProps {
33
+ return NitroVerifyPurchaseWithIapkitGoogleProps(purchaseToken)
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,42 @@
1
+ ///
2
+ /// NitroVerifyPurchaseWithIapkitProps.kt
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
+ package com.margelo.nitro.iap
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "NitroVerifyPurchaseWithIapkitProps".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class NitroVerifyPurchaseWithIapkitProps(
20
+ @DoNotStrip
21
+ @Keep
22
+ val apiKey: String?,
23
+ @DoNotStrip
24
+ @Keep
25
+ val apple: NitroVerifyPurchaseWithIapkitAppleProps?,
26
+ @DoNotStrip
27
+ @Keep
28
+ val google: NitroVerifyPurchaseWithIapkitGoogleProps?
29
+ ) {
30
+ private companion object {
31
+ /**
32
+ * Constructor called from C++
33
+ */
34
+ @DoNotStrip
35
+ @Keep
36
+ @Suppress("unused")
37
+ @JvmStatic
38
+ private fun fromCpp(apiKey: String?, apple: NitroVerifyPurchaseWithIapkitAppleProps?, google: NitroVerifyPurchaseWithIapkitGoogleProps?): NitroVerifyPurchaseWithIapkitProps {
39
+ return NitroVerifyPurchaseWithIapkitProps(apiKey, apple, google)
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,42 @@
1
+ ///
2
+ /// NitroVerifyPurchaseWithIapkitResult.kt
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
+ package com.margelo.nitro.iap
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "NitroVerifyPurchaseWithIapkitResult".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class NitroVerifyPurchaseWithIapkitResult(
20
+ @DoNotStrip
21
+ @Keep
22
+ val isValid: Boolean,
23
+ @DoNotStrip
24
+ @Keep
25
+ val state: IapkitPurchaseState,
26
+ @DoNotStrip
27
+ @Keep
28
+ val store: IapkitStore
29
+ ) {
30
+ private companion object {
31
+ /**
32
+ * Constructor called from C++
33
+ */
34
+ @DoNotStrip
35
+ @Keep
36
+ @Suppress("unused")
37
+ @JvmStatic
38
+ private fun fromCpp(isValid: Boolean, state: IapkitPurchaseState, store: IapkitStore): NitroVerifyPurchaseWithIapkitResult {
39
+ return NitroVerifyPurchaseWithIapkitResult(isValid, state, store)
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,39 @@
1
+ ///
2
+ /// NitroVerifyPurchaseWithProviderProps.kt
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
+ package com.margelo.nitro.iap
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "NitroVerifyPurchaseWithProviderProps".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class NitroVerifyPurchaseWithProviderProps(
20
+ @DoNotStrip
21
+ @Keep
22
+ val iapkit: NitroVerifyPurchaseWithIapkitProps?,
23
+ @DoNotStrip
24
+ @Keep
25
+ val provider: PurchaseVerificationProvider
26
+ ) {
27
+ private companion object {
28
+ /**
29
+ * Constructor called from C++
30
+ */
31
+ @DoNotStrip
32
+ @Keep
33
+ @Suppress("unused")
34
+ @JvmStatic
35
+ private fun fromCpp(iapkit: NitroVerifyPurchaseWithIapkitProps?, provider: PurchaseVerificationProvider): NitroVerifyPurchaseWithProviderProps {
36
+ return NitroVerifyPurchaseWithProviderProps(iapkit, provider)
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,39 @@
1
+ ///
2
+ /// NitroVerifyPurchaseWithProviderResult.kt
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
+ package com.margelo.nitro.iap
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "NitroVerifyPurchaseWithProviderResult".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class NitroVerifyPurchaseWithProviderResult(
20
+ @DoNotStrip
21
+ @Keep
22
+ val iapkit: Array<NitroVerifyPurchaseWithIapkitResult>,
23
+ @DoNotStrip
24
+ @Keep
25
+ val provider: PurchaseVerificationProvider
26
+ ) {
27
+ private companion object {
28
+ /**
29
+ * Constructor called from C++
30
+ */
31
+ @DoNotStrip
32
+ @Keep
33
+ @Suppress("unused")
34
+ @JvmStatic
35
+ private fun fromCpp(iapkit: Array<NitroVerifyPurchaseWithIapkitResult>, provider: PurchaseVerificationProvider): NitroVerifyPurchaseWithProviderResult {
36
+ return NitroVerifyPurchaseWithProviderResult(iapkit, provider)
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,21 @@
1
+ ///
2
+ /// PurchaseVerificationProvider.kt
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
+ package com.margelo.nitro.iap
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+ /**
14
+ * Represents the JavaScript enum/union "PurchaseVerificationProvider".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class PurchaseVerificationProvider(@DoNotStrip @Keep val value: Int) {
19
+ NONE(0),
20
+ IAPKIT(1);
21
+ }
@@ -149,6 +149,14 @@ namespace margelo::nitro::iap::bridge::swift {
149
149
  };
150
150
  }
151
151
 
152
+ // pragma MARK: std::function<void(const NitroVerifyPurchaseWithProviderResult& /* result */)>
153
+ Func_void_NitroVerifyPurchaseWithProviderResult create_Func_void_NitroVerifyPurchaseWithProviderResult(void* NON_NULL swiftClosureWrapper) noexcept {
154
+ auto swiftClosure = NitroIap::Func_void_NitroVerifyPurchaseWithProviderResult::fromUnsafe(swiftClosureWrapper);
155
+ return [swiftClosure = std::move(swiftClosure)](const NitroVerifyPurchaseWithProviderResult& result) mutable -> void {
156
+ swiftClosure.call(result);
157
+ };
158
+ }
159
+
152
160
  // pragma MARK: std::function<void(const UserChoiceBillingDetails& /* details */)>
153
161
  Func_void_UserChoiceBillingDetails create_Func_void_UserChoiceBillingDetails(void* NON_NULL swiftClosureWrapper) noexcept {
154
162
  auto swiftClosure = NitroIap::Func_void_UserChoiceBillingDetails::fromUnsafe(swiftClosureWrapper);
@@ -22,6 +22,10 @@ namespace margelo::nitro::iap { struct ExternalPurchaseNoticeResultIOS; }
22
22
  namespace margelo::nitro::iap { class HybridRnIapSpec; }
23
23
  // Forward declaration of `IapPlatform` to properly resolve imports.
24
24
  namespace margelo::nitro::iap { enum class IapPlatform; }
25
+ // Forward declaration of `IapkitPurchaseState` to properly resolve imports.
26
+ namespace margelo::nitro::iap { enum class IapkitPurchaseState; }
27
+ // Forward declaration of `IapkitStore` to properly resolve imports.
28
+ namespace margelo::nitro::iap { enum class IapkitStore; }
25
29
  // Forward declaration of `InitConnectionConfig` to properly resolve imports.
26
30
  namespace margelo::nitro::iap { struct InitConnectionConfig; }
27
31
  // Forward declaration of `NitroActiveSubscription` to properly resolve imports.
@@ -62,6 +66,16 @@ namespace margelo::nitro::iap { struct NitroRequestPurchaseIos; }
62
66
  namespace margelo::nitro::iap { struct NitroSubscriptionRenewalInfo; }
63
67
  // Forward declaration of `NitroSubscriptionStatus` to properly resolve imports.
64
68
  namespace margelo::nitro::iap { struct NitroSubscriptionStatus; }
69
+ // Forward declaration of `NitroVerifyPurchaseWithIapkitAppleProps` to properly resolve imports.
70
+ namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitAppleProps; }
71
+ // Forward declaration of `NitroVerifyPurchaseWithIapkitGoogleProps` to properly resolve imports.
72
+ namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitGoogleProps; }
73
+ // Forward declaration of `NitroVerifyPurchaseWithIapkitProps` to properly resolve imports.
74
+ namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitProps; }
75
+ // Forward declaration of `NitroVerifyPurchaseWithIapkitResult` to properly resolve imports.
76
+ namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitResult; }
77
+ // Forward declaration of `NitroVerifyPurchaseWithProviderResult` to properly resolve imports.
78
+ namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithProviderResult; }
65
79
  // Forward declaration of `PaymentModeIOS` to properly resolve imports.
66
80
  namespace margelo::nitro::iap { enum class PaymentModeIOS; }
67
81
  // Forward declaration of `PurchaseAndroid` to properly resolve imports.
@@ -72,6 +86,8 @@ namespace margelo::nitro::iap { struct PurchaseIOS; }
72
86
  namespace margelo::nitro::iap { struct PurchaseOfferIOS; }
73
87
  // Forward declaration of `PurchaseState` to properly resolve imports.
74
88
  namespace margelo::nitro::iap { enum class PurchaseState; }
89
+ // Forward declaration of `PurchaseVerificationProvider` to properly resolve imports.
90
+ namespace margelo::nitro::iap { enum class PurchaseVerificationProvider; }
75
91
  // Forward declaration of `RenewalInfoIOS` to properly resolve imports.
76
92
  namespace margelo::nitro::iap { struct RenewalInfoIOS; }
77
93
  // Forward declaration of `UserChoiceBillingDetails` to properly resolve imports.
@@ -89,6 +105,8 @@ namespace NitroIap { class HybridRnIapSpec_cxx; }
89
105
  #include "ExternalPurchaseNoticeResultIOS.hpp"
90
106
  #include "HybridRnIapSpec.hpp"
91
107
  #include "IapPlatform.hpp"
108
+ #include "IapkitPurchaseState.hpp"
109
+ #include "IapkitStore.hpp"
92
110
  #include "InitConnectionConfig.hpp"
93
111
  #include "NitroActiveSubscription.hpp"
94
112
  #include "NitroAvailablePurchasesAndroidOptions.hpp"
@@ -109,11 +127,17 @@ namespace NitroIap { class HybridRnIapSpec_cxx; }
109
127
  #include "NitroRequestPurchaseIos.hpp"
110
128
  #include "NitroSubscriptionRenewalInfo.hpp"
111
129
  #include "NitroSubscriptionStatus.hpp"
130
+ #include "NitroVerifyPurchaseWithIapkitAppleProps.hpp"
131
+ #include "NitroVerifyPurchaseWithIapkitGoogleProps.hpp"
132
+ #include "NitroVerifyPurchaseWithIapkitProps.hpp"
133
+ #include "NitroVerifyPurchaseWithIapkitResult.hpp"
134
+ #include "NitroVerifyPurchaseWithProviderResult.hpp"
112
135
  #include "PaymentModeIOS.hpp"
113
136
  #include "PurchaseAndroid.hpp"
114
137
  #include "PurchaseIOS.hpp"
115
138
  #include "PurchaseOfferIOS.hpp"
116
139
  #include "PurchaseState.hpp"
140
+ #include "PurchaseVerificationProvider.hpp"
117
141
  #include "RenewalInfoIOS.hpp"
118
142
  #include "UserChoiceBillingDetails.hpp"
119
143
  #include <NitroModules/FastVectorCopy.hpp>
@@ -1279,6 +1303,96 @@ namespace margelo::nitro::iap::bridge::swift {
1279
1303
  return *optional;
1280
1304
  }
1281
1305
 
1306
+ // pragma MARK: std::vector<NitroVerifyPurchaseWithIapkitResult>
1307
+ /**
1308
+ * Specialized version of `std::vector<NitroVerifyPurchaseWithIapkitResult>`.
1309
+ */
1310
+ using std__vector_NitroVerifyPurchaseWithIapkitResult_ = std::vector<NitroVerifyPurchaseWithIapkitResult>;
1311
+ inline std::vector<NitroVerifyPurchaseWithIapkitResult> create_std__vector_NitroVerifyPurchaseWithIapkitResult_(size_t size) noexcept {
1312
+ std::vector<NitroVerifyPurchaseWithIapkitResult> vector;
1313
+ vector.reserve(size);
1314
+ return vector;
1315
+ }
1316
+
1317
+ // pragma MARK: std::shared_ptr<Promise<NitroVerifyPurchaseWithProviderResult>>
1318
+ /**
1319
+ * Specialized version of `std::shared_ptr<Promise<NitroVerifyPurchaseWithProviderResult>>`.
1320
+ */
1321
+ using std__shared_ptr_Promise_NitroVerifyPurchaseWithProviderResult__ = std::shared_ptr<Promise<NitroVerifyPurchaseWithProviderResult>>;
1322
+ inline std::shared_ptr<Promise<NitroVerifyPurchaseWithProviderResult>> create_std__shared_ptr_Promise_NitroVerifyPurchaseWithProviderResult__() noexcept {
1323
+ return Promise<NitroVerifyPurchaseWithProviderResult>::create();
1324
+ }
1325
+ inline PromiseHolder<NitroVerifyPurchaseWithProviderResult> wrap_std__shared_ptr_Promise_NitroVerifyPurchaseWithProviderResult__(std::shared_ptr<Promise<NitroVerifyPurchaseWithProviderResult>> promise) noexcept {
1326
+ return PromiseHolder<NitroVerifyPurchaseWithProviderResult>(std::move(promise));
1327
+ }
1328
+
1329
+ // pragma MARK: std::function<void(const NitroVerifyPurchaseWithProviderResult& /* result */)>
1330
+ /**
1331
+ * Specialized version of `std::function<void(const NitroVerifyPurchaseWithProviderResult&)>`.
1332
+ */
1333
+ using Func_void_NitroVerifyPurchaseWithProviderResult = std::function<void(const NitroVerifyPurchaseWithProviderResult& /* result */)>;
1334
+ /**
1335
+ * Wrapper class for a `std::function<void(const NitroVerifyPurchaseWithProviderResult& / * result * /)>`, this can be used from Swift.
1336
+ */
1337
+ class Func_void_NitroVerifyPurchaseWithProviderResult_Wrapper final {
1338
+ public:
1339
+ explicit Func_void_NitroVerifyPurchaseWithProviderResult_Wrapper(std::function<void(const NitroVerifyPurchaseWithProviderResult& /* result */)>&& func): _function(std::make_unique<std::function<void(const NitroVerifyPurchaseWithProviderResult& /* result */)>>(std::move(func))) {}
1340
+ inline void call(NitroVerifyPurchaseWithProviderResult result) const noexcept {
1341
+ _function->operator()(result);
1342
+ }
1343
+ private:
1344
+ std::unique_ptr<std::function<void(const NitroVerifyPurchaseWithProviderResult& /* result */)>> _function;
1345
+ } SWIFT_NONCOPYABLE;
1346
+ Func_void_NitroVerifyPurchaseWithProviderResult create_Func_void_NitroVerifyPurchaseWithProviderResult(void* NON_NULL swiftClosureWrapper) noexcept;
1347
+ inline Func_void_NitroVerifyPurchaseWithProviderResult_Wrapper wrap_Func_void_NitroVerifyPurchaseWithProviderResult(Func_void_NitroVerifyPurchaseWithProviderResult value) noexcept {
1348
+ return Func_void_NitroVerifyPurchaseWithProviderResult_Wrapper(std::move(value));
1349
+ }
1350
+
1351
+ // pragma MARK: std::optional<NitroVerifyPurchaseWithIapkitAppleProps>
1352
+ /**
1353
+ * Specialized version of `std::optional<NitroVerifyPurchaseWithIapkitAppleProps>`.
1354
+ */
1355
+ using std__optional_NitroVerifyPurchaseWithIapkitAppleProps_ = std::optional<NitroVerifyPurchaseWithIapkitAppleProps>;
1356
+ inline std::optional<NitroVerifyPurchaseWithIapkitAppleProps> create_std__optional_NitroVerifyPurchaseWithIapkitAppleProps_(const NitroVerifyPurchaseWithIapkitAppleProps& value) noexcept {
1357
+ return std::optional<NitroVerifyPurchaseWithIapkitAppleProps>(value);
1358
+ }
1359
+ inline bool has_value_std__optional_NitroVerifyPurchaseWithIapkitAppleProps_(const std::optional<NitroVerifyPurchaseWithIapkitAppleProps>& optional) noexcept {
1360
+ return optional.has_value();
1361
+ }
1362
+ inline NitroVerifyPurchaseWithIapkitAppleProps get_std__optional_NitroVerifyPurchaseWithIapkitAppleProps_(const std::optional<NitroVerifyPurchaseWithIapkitAppleProps>& optional) noexcept {
1363
+ return *optional;
1364
+ }
1365
+
1366
+ // pragma MARK: std::optional<NitroVerifyPurchaseWithIapkitGoogleProps>
1367
+ /**
1368
+ * Specialized version of `std::optional<NitroVerifyPurchaseWithIapkitGoogleProps>`.
1369
+ */
1370
+ using std__optional_NitroVerifyPurchaseWithIapkitGoogleProps_ = std::optional<NitroVerifyPurchaseWithIapkitGoogleProps>;
1371
+ inline std::optional<NitroVerifyPurchaseWithIapkitGoogleProps> create_std__optional_NitroVerifyPurchaseWithIapkitGoogleProps_(const NitroVerifyPurchaseWithIapkitGoogleProps& value) noexcept {
1372
+ return std::optional<NitroVerifyPurchaseWithIapkitGoogleProps>(value);
1373
+ }
1374
+ inline bool has_value_std__optional_NitroVerifyPurchaseWithIapkitGoogleProps_(const std::optional<NitroVerifyPurchaseWithIapkitGoogleProps>& optional) noexcept {
1375
+ return optional.has_value();
1376
+ }
1377
+ inline NitroVerifyPurchaseWithIapkitGoogleProps get_std__optional_NitroVerifyPurchaseWithIapkitGoogleProps_(const std::optional<NitroVerifyPurchaseWithIapkitGoogleProps>& optional) noexcept {
1378
+ return *optional;
1379
+ }
1380
+
1381
+ // pragma MARK: std::optional<NitroVerifyPurchaseWithIapkitProps>
1382
+ /**
1383
+ * Specialized version of `std::optional<NitroVerifyPurchaseWithIapkitProps>`.
1384
+ */
1385
+ using std__optional_NitroVerifyPurchaseWithIapkitProps_ = std::optional<NitroVerifyPurchaseWithIapkitProps>;
1386
+ inline std::optional<NitroVerifyPurchaseWithIapkitProps> create_std__optional_NitroVerifyPurchaseWithIapkitProps_(const NitroVerifyPurchaseWithIapkitProps& value) noexcept {
1387
+ return std::optional<NitroVerifyPurchaseWithIapkitProps>(value);
1388
+ }
1389
+ inline bool has_value_std__optional_NitroVerifyPurchaseWithIapkitProps_(const std::optional<NitroVerifyPurchaseWithIapkitProps>& optional) noexcept {
1390
+ return optional.has_value();
1391
+ }
1392
+ inline NitroVerifyPurchaseWithIapkitProps get_std__optional_NitroVerifyPurchaseWithIapkitProps_(const std::optional<NitroVerifyPurchaseWithIapkitProps>& optional) noexcept {
1393
+ return *optional;
1394
+ }
1395
+
1282
1396
  // pragma MARK: std::function<void(const UserChoiceBillingDetails& /* details */)>
1283
1397
  /**
1284
1398
  * Specialized version of `std::function<void(const UserChoiceBillingDetails&)>`.
@@ -1507,6 +1621,15 @@ namespace margelo::nitro::iap::bridge::swift {
1507
1621
  return Result<std::shared_ptr<Promise<std::variant<NitroReceiptValidationResultIOS, NitroReceiptValidationResultAndroid>>>>::withError(error);
1508
1622
  }
1509
1623
 
1624
+ // pragma MARK: Result<std::shared_ptr<Promise<NitroVerifyPurchaseWithProviderResult>>>
1625
+ using Result_std__shared_ptr_Promise_NitroVerifyPurchaseWithProviderResult___ = Result<std::shared_ptr<Promise<NitroVerifyPurchaseWithProviderResult>>>;
1626
+ inline Result_std__shared_ptr_Promise_NitroVerifyPurchaseWithProviderResult___ create_Result_std__shared_ptr_Promise_NitroVerifyPurchaseWithProviderResult___(const std::shared_ptr<Promise<NitroVerifyPurchaseWithProviderResult>>& value) noexcept {
1627
+ return Result<std::shared_ptr<Promise<NitroVerifyPurchaseWithProviderResult>>>::withValue(value);
1628
+ }
1629
+ inline Result_std__shared_ptr_Promise_NitroVerifyPurchaseWithProviderResult___ create_Result_std__shared_ptr_Promise_NitroVerifyPurchaseWithProviderResult___(const std::exception_ptr& error) noexcept {
1630
+ return Result<std::shared_ptr<Promise<NitroVerifyPurchaseWithProviderResult>>>::withError(error);
1631
+ }
1632
+
1510
1633
  // pragma MARK: Result<std::shared_ptr<Promise<ExternalPurchaseNoticeResultIOS>>>
1511
1634
  using Result_std__shared_ptr_Promise_ExternalPurchaseNoticeResultIOS___ = Result<std::shared_ptr<Promise<ExternalPurchaseNoticeResultIOS>>>;
1512
1635
  inline Result_std__shared_ptr_Promise_ExternalPurchaseNoticeResultIOS___ create_Result_std__shared_ptr_Promise_ExternalPurchaseNoticeResultIOS___(const std::shared_ptr<Promise<ExternalPurchaseNoticeResultIOS>>& value) noexcept {