react-native-iap 14.4.47 → 14.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +29 -9
  2. package/ios/HybridRnIap.swift +17 -5
  3. package/ios/RnIapHelper.swift +8 -0
  4. package/lib/module/index.js +6 -5
  5. package/lib/module/index.js.map +1 -1
  6. package/lib/module/types.js.map +1 -1
  7. package/lib/module/utils/type-bridge.js +19 -0
  8. package/lib/module/utils/type-bridge.js.map +1 -1
  9. package/lib/typescript/src/index.d.ts.map +1 -1
  10. package/lib/typescript/src/specs/RnIap.nitro.d.ts +17 -3
  11. package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
  12. package/lib/typescript/src/types.d.ts +40 -8
  13. package/lib/typescript/src/types.d.ts.map +1 -1
  14. package/lib/typescript/src/utils/type-bridge.d.ts.map +1 -1
  15. package/nitrogen/generated/android/c++/JFunc_void_NitroPurchase.hpp +2 -0
  16. package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +8 -4
  17. package/nitrogen/generated/android/c++/{JIapkitStore.hpp → JIapStore.hpp} +19 -13
  18. package/nitrogen/generated/android/c++/JNitroPurchase.hpp +7 -1
  19. package/nitrogen/generated/android/c++/JNitroPurchaseRequest.hpp +11 -3
  20. package/nitrogen/generated/android/c++/JNitroReceiptValidationResultIOS.hpp +2 -0
  21. package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithIapkitResult.hpp +6 -6
  22. package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithProviderError.hpp +62 -0
  23. package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithProviderResult.hpp +24 -16
  24. package/nitrogen/generated/android/c++/JPurchase.hpp +2 -0
  25. package/nitrogen/generated/android/c++/JPurchaseAndroid.hpp +7 -1
  26. package/nitrogen/generated/android/c++/JPurchaseIOS.hpp +7 -1
  27. package/nitrogen/generated/android/c++/JRequestPurchaseResult.hpp +2 -0
  28. package/nitrogen/generated/android/c++/JVariant_NitroReceiptValidationResultIOS_NitroReceiptValidationResultAndroid.hpp +2 -0
  29. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/{IapkitStore.kt → IapStore.kt} +7 -5
  30. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchase.kt +5 -2
  31. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchaseRequest.kt +9 -3
  32. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithIapkitResult.kt +2 -2
  33. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithProviderError.kt +39 -0
  34. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithProviderResult.kt +6 -3
  35. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseAndroid.kt +5 -2
  36. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseIOS.kt +5 -2
  37. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +41 -8
  38. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +6 -3
  39. package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +6 -3
  40. package/nitrogen/generated/ios/swift/{IapkitStore.swift → IapStore.swift} +14 -6
  41. package/nitrogen/generated/ios/swift/NitroPurchase.swift +13 -2
  42. package/nitrogen/generated/ios/swift/NitroPurchaseRequest.swift +47 -1
  43. package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithIapkitResult.swift +2 -2
  44. package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithProviderError.swift +65 -0
  45. package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithProviderResult.swift +55 -13
  46. package/nitrogen/generated/ios/swift/PurchaseAndroid.swift +13 -2
  47. package/nitrogen/generated/ios/swift/PurchaseIOS.swift +13 -2
  48. package/nitrogen/generated/shared/c++/{IapkitStore.hpp → IapStore.hpp} +23 -15
  49. package/nitrogen/generated/shared/c++/NitroPurchase.hpp +8 -1
  50. package/nitrogen/generated/shared/c++/NitroPurchaseRequest.hpp +10 -2
  51. package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithIapkitResult.hpp +8 -8
  52. package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithProviderError.hpp +80 -0
  53. package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithProviderResult.hpp +13 -5
  54. package/nitrogen/generated/shared/c++/PurchaseAndroid.hpp +8 -1
  55. package/nitrogen/generated/shared/c++/PurchaseIOS.hpp +8 -1
  56. package/openiap-versions.json +3 -3
  57. package/package.json +1 -1
  58. package/src/index.ts +8 -5
  59. package/src/specs/RnIap.nitro.ts +19 -3
  60. package/src/types.ts +42 -9
  61. package/src/utils/type-bridge.ts +22 -0
@@ -10,14 +10,18 @@
10
10
  #include <fbjni/fbjni.h>
11
11
  #include "NitroVerifyPurchaseWithProviderResult.hpp"
12
12
 
13
+ #include "IapStore.hpp"
13
14
  #include "IapkitPurchaseState.hpp"
14
- #include "IapkitStore.hpp"
15
+ #include "JIapStore.hpp"
15
16
  #include "JIapkitPurchaseState.hpp"
16
- #include "JIapkitStore.hpp"
17
17
  #include "JNitroVerifyPurchaseWithIapkitResult.hpp"
18
+ #include "JNitroVerifyPurchaseWithProviderError.hpp"
18
19
  #include "JPurchaseVerificationProvider.hpp"
19
20
  #include "NitroVerifyPurchaseWithIapkitResult.hpp"
21
+ #include "NitroVerifyPurchaseWithProviderError.hpp"
20
22
  #include "PurchaseVerificationProvider.hpp"
23
+ #include <optional>
24
+ #include <string>
21
25
  #include <vector>
22
26
 
23
27
  namespace margelo::nitro::iap {
@@ -39,21 +43,24 @@ namespace margelo::nitro::iap {
39
43
  [[nodiscard]]
40
44
  NitroVerifyPurchaseWithProviderResult toCpp() const {
41
45
  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);
46
+ static const auto fieldIapkit = clazz->getField<JNitroVerifyPurchaseWithIapkitResult>("iapkit");
47
+ jni::local_ref<JNitroVerifyPurchaseWithIapkitResult> iapkit = this->getFieldValue(fieldIapkit);
48
+ static const auto fieldErrors = clazz->getField<jni::JArrayClass<JNitroVerifyPurchaseWithProviderError>>("errors");
49
+ jni::local_ref<jni::JArrayClass<JNitroVerifyPurchaseWithProviderError>> errors = this->getFieldValue(fieldErrors);
44
50
  static const auto fieldProvider = clazz->getField<JPurchaseVerificationProvider>("provider");
45
51
  jni::local_ref<JPurchaseVerificationProvider> provider = this->getFieldValue(fieldProvider);
46
52
  return NitroVerifyPurchaseWithProviderResult(
47
- [&]() {
48
- size_t __size = iapkit->size();
49
- std::vector<NitroVerifyPurchaseWithIapkitResult> __vector;
53
+ iapkit != nullptr ? std::make_optional(iapkit->toCpp()) : std::nullopt,
54
+ errors != nullptr ? std::make_optional([&]() {
55
+ size_t __size = errors->size();
56
+ std::vector<NitroVerifyPurchaseWithProviderError> __vector;
50
57
  __vector.reserve(__size);
51
58
  for (size_t __i = 0; __i < __size; __i++) {
52
- auto __element = iapkit->getElement(__i);
59
+ auto __element = errors->getElement(__i);
53
60
  __vector.push_back(__element->toCpp());
54
61
  }
55
62
  return __vector;
56
- }(),
63
+ }()) : std::nullopt,
57
64
  provider->toCpp()
58
65
  );
59
66
  }
@@ -64,20 +71,21 @@ namespace margelo::nitro::iap {
64
71
  */
65
72
  [[maybe_unused]]
66
73
  static jni::local_ref<JNitroVerifyPurchaseWithProviderResult::javaobject> fromCpp(const NitroVerifyPurchaseWithProviderResult& value) {
67
- using JSignature = JNitroVerifyPurchaseWithProviderResult(jni::alias_ref<jni::JArrayClass<JNitroVerifyPurchaseWithIapkitResult>>, jni::alias_ref<JPurchaseVerificationProvider>);
74
+ using JSignature = JNitroVerifyPurchaseWithProviderResult(jni::alias_ref<JNitroVerifyPurchaseWithIapkitResult>, jni::alias_ref<jni::JArrayClass<JNitroVerifyPurchaseWithProviderError>>, jni::alias_ref<JPurchaseVerificationProvider>);
68
75
  static const auto clazz = javaClassStatic();
69
76
  static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
70
77
  return create(
71
78
  clazz,
72
- [&]() {
73
- size_t __size = value.iapkit.size();
74
- jni::local_ref<jni::JArrayClass<JNitroVerifyPurchaseWithIapkitResult>> __array = jni::JArrayClass<JNitroVerifyPurchaseWithIapkitResult>::newArray(__size);
79
+ value.iapkit.has_value() ? JNitroVerifyPurchaseWithIapkitResult::fromCpp(value.iapkit.value()) : nullptr,
80
+ value.errors.has_value() ? [&]() {
81
+ size_t __size = value.errors.value().size();
82
+ jni::local_ref<jni::JArrayClass<JNitroVerifyPurchaseWithProviderError>> __array = jni::JArrayClass<JNitroVerifyPurchaseWithProviderError>::newArray(__size);
75
83
  for (size_t __i = 0; __i < __size; __i++) {
76
- const auto& __element = value.iapkit[__i];
77
- __array->setElement(__i, *JNitroVerifyPurchaseWithIapkitResult::fromCpp(__element));
84
+ const auto& __element = value.errors.value()[__i];
85
+ __array->setElement(__i, *JNitroVerifyPurchaseWithProviderError::fromCpp(__element));
78
86
  }
79
87
  return __array;
80
- }(),
88
+ }() : nullptr,
81
89
  JPurchaseVerificationProvider::fromCpp(value.provider)
82
90
  );
83
91
  }
@@ -21,6 +21,8 @@
21
21
  #include "JIapPlatform.hpp"
22
22
  #include "PurchaseState.hpp"
23
23
  #include "JPurchaseState.hpp"
24
+ #include "IapStore.hpp"
25
+ #include "JIapStore.hpp"
24
26
  #include "JPurchaseIOS.hpp"
25
27
  #include "PurchaseOfferIOS.hpp"
26
28
  #include "JPurchaseOfferIOS.hpp"
@@ -11,7 +11,9 @@
11
11
  #include "PurchaseAndroid.hpp"
12
12
 
13
13
  #include "IapPlatform.hpp"
14
+ #include "IapStore.hpp"
14
15
  #include "JIapPlatform.hpp"
16
+ #include "JIapStore.hpp"
15
17
  #include "JPurchaseState.hpp"
16
18
  #include "PurchaseState.hpp"
17
19
  #include <optional>
@@ -71,6 +73,8 @@ namespace margelo::nitro::iap {
71
73
  double quantity = this->getFieldValue(fieldQuantity);
72
74
  static const auto fieldSignatureAndroid = clazz->getField<jni::JString>("signatureAndroid");
73
75
  jni::local_ref<jni::JString> signatureAndroid = this->getFieldValue(fieldSignatureAndroid);
76
+ static const auto fieldStore = clazz->getField<JIapStore>("store");
77
+ jni::local_ref<JIapStore> store = this->getFieldValue(fieldStore);
74
78
  static const auto fieldTransactionDate = clazz->getField<double>("transactionDate");
75
79
  double transactionDate = this->getFieldValue(fieldTransactionDate);
76
80
  static const auto fieldTransactionId = clazz->getField<jni::JString>("transactionId");
@@ -102,6 +106,7 @@ namespace margelo::nitro::iap {
102
106
  purchaseToken != nullptr ? std::make_optional(purchaseToken->toStdString()) : std::nullopt,
103
107
  quantity,
104
108
  signatureAndroid != nullptr ? std::make_optional(signatureAndroid->toStdString()) : std::nullopt,
109
+ store->toCpp(),
105
110
  transactionDate,
106
111
  transactionId != nullptr ? std::make_optional(transactionId->toStdString()) : std::nullopt
107
112
  );
@@ -113,7 +118,7 @@ namespace margelo::nitro::iap {
113
118
  */
114
119
  [[maybe_unused]]
115
120
  static jni::local_ref<JPurchaseAndroid::javaobject> fromCpp(const PurchaseAndroid& value) {
116
- using JSignature = JPurchaseAndroid(jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JArrayClass<jni::JString>>, jni::alias_ref<jni::JBoolean>, jboolean, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<JIapPlatform>, jni::alias_ref<jni::JString>, jni::alias_ref<JPurchaseState>, jni::alias_ref<jni::JString>, double, jni::alias_ref<jni::JString>, double, jni::alias_ref<jni::JString>);
121
+ using JSignature = JPurchaseAndroid(jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JArrayClass<jni::JString>>, jni::alias_ref<jni::JBoolean>, jboolean, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<JIapPlatform>, jni::alias_ref<jni::JString>, jni::alias_ref<JPurchaseState>, jni::alias_ref<jni::JString>, double, jni::alias_ref<jni::JString>, jni::alias_ref<JIapStore>, double, jni::alias_ref<jni::JString>);
117
122
  static const auto clazz = javaClassStatic();
118
123
  static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
119
124
  return create(
@@ -143,6 +148,7 @@ namespace margelo::nitro::iap {
143
148
  value.purchaseToken.has_value() ? jni::make_jstring(value.purchaseToken.value()) : nullptr,
144
149
  value.quantity,
145
150
  value.signatureAndroid.has_value() ? jni::make_jstring(value.signatureAndroid.value()) : nullptr,
151
+ JIapStore::fromCpp(value.store),
146
152
  value.transactionDate,
147
153
  value.transactionId.has_value() ? jni::make_jstring(value.transactionId.value()) : nullptr
148
154
  );
@@ -11,7 +11,9 @@
11
11
  #include "PurchaseIOS.hpp"
12
12
 
13
13
  #include "IapPlatform.hpp"
14
+ #include "IapStore.hpp"
14
15
  #include "JIapPlatform.hpp"
16
+ #include "JIapStore.hpp"
15
17
  #include "JPurchaseOfferIOS.hpp"
16
18
  #include "JPurchaseState.hpp"
17
19
  #include "JRenewalInfoIOS.hpp"
@@ -95,6 +97,8 @@ namespace margelo::nitro::iap {
95
97
  jni::local_ref<jni::JDouble> revocationDateIOS = this->getFieldValue(fieldRevocationDateIOS);
96
98
  static const auto fieldRevocationReasonIOS = clazz->getField<jni::JString>("revocationReasonIOS");
97
99
  jni::local_ref<jni::JString> revocationReasonIOS = this->getFieldValue(fieldRevocationReasonIOS);
100
+ static const auto fieldStore = clazz->getField<JIapStore>("store");
101
+ jni::local_ref<JIapStore> store = this->getFieldValue(fieldStore);
98
102
  static const auto fieldStorefrontCountryCodeIOS = clazz->getField<jni::JString>("storefrontCountryCodeIOS");
99
103
  jni::local_ref<jni::JString> storefrontCountryCodeIOS = this->getFieldValue(fieldStorefrontCountryCodeIOS);
100
104
  static const auto fieldSubscriptionGroupIdIOS = clazz->getField<jni::JString>("subscriptionGroupIdIOS");
@@ -144,6 +148,7 @@ namespace margelo::nitro::iap {
144
148
  renewalInfoIOS != nullptr ? std::make_optional(renewalInfoIOS->toCpp()) : std::nullopt,
145
149
  revocationDateIOS != nullptr ? std::make_optional(revocationDateIOS->value()) : std::nullopt,
146
150
  revocationReasonIOS != nullptr ? std::make_optional(revocationReasonIOS->toStdString()) : std::nullopt,
151
+ store->toCpp(),
147
152
  storefrontCountryCodeIOS != nullptr ? std::make_optional(storefrontCountryCodeIOS->toStdString()) : std::nullopt,
148
153
  subscriptionGroupIdIOS != nullptr ? std::make_optional(subscriptionGroupIdIOS->toStdString()) : std::nullopt,
149
154
  transactionDate,
@@ -159,7 +164,7 @@ namespace margelo::nitro::iap {
159
164
  */
160
165
  [[maybe_unused]]
161
166
  static jni::local_ref<JPurchaseIOS::javaobject> fromCpp(const PurchaseIOS& value) {
162
- using JSignature = JPurchaseIOS(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JArrayClass<jni::JString>>, jboolean, jni::alias_ref<jni::JBoolean>, jni::alias_ref<JPurchaseOfferIOS>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<JIapPlatform>, jni::alias_ref<jni::JString>, jni::alias_ref<JPurchaseState>, jni::alias_ref<jni::JString>, double, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<JRenewalInfoIOS>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, double, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>);
167
+ using JSignature = JPurchaseIOS(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JArrayClass<jni::JString>>, jboolean, jni::alias_ref<jni::JBoolean>, jni::alias_ref<JPurchaseOfferIOS>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<JIapPlatform>, jni::alias_ref<jni::JString>, jni::alias_ref<JPurchaseState>, jni::alias_ref<jni::JString>, double, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<JRenewalInfoIOS>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JString>, jni::alias_ref<JIapStore>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, double, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>);
163
168
  static const auto clazz = javaClassStatic();
164
169
  static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
165
170
  return create(
@@ -199,6 +204,7 @@ namespace margelo::nitro::iap {
199
204
  value.renewalInfoIOS.has_value() ? JRenewalInfoIOS::fromCpp(value.renewalInfoIOS.value()) : nullptr,
200
205
  value.revocationDateIOS.has_value() ? jni::JDouble::valueOf(value.revocationDateIOS.value()) : nullptr,
201
206
  value.revocationReasonIOS.has_value() ? jni::make_jstring(value.revocationReasonIOS.value()) : nullptr,
207
+ JIapStore::fromCpp(value.store),
202
208
  value.storefrontCountryCodeIOS.has_value() ? jni::make_jstring(value.storefrontCountryCodeIOS.value()) : nullptr,
203
209
  value.subscriptionGroupIdIOS.has_value() ? jni::make_jstring(value.subscriptionGroupIdIOS.value()) : nullptr,
204
210
  value.transactionDate,
@@ -21,6 +21,8 @@
21
21
  #include "JIapPlatform.hpp"
22
22
  #include "PurchaseState.hpp"
23
23
  #include "JPurchaseState.hpp"
24
+ #include "IapStore.hpp"
25
+ #include "JIapStore.hpp"
24
26
  #include "JPurchaseIOS.hpp"
25
27
  #include "PurchaseOfferIOS.hpp"
26
28
  #include "JPurchaseOfferIOS.hpp"
@@ -20,6 +20,8 @@
20
20
  #include "JNitroPurchase.hpp"
21
21
  #include "IapPlatform.hpp"
22
22
  #include "JIapPlatform.hpp"
23
+ #include "IapStore.hpp"
24
+ #include "JIapStore.hpp"
23
25
  #include "PurchaseState.hpp"
24
26
  #include "JPurchaseState.hpp"
25
27
  #include "NitroRenewalInfoIOS.hpp"
@@ -1,5 +1,5 @@
1
1
  ///
2
- /// IapkitStore.kt
2
+ /// IapStore.kt
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
@@ -11,11 +11,13 @@ import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
12
 
13
13
  /**
14
- * Represents the JavaScript enum/union "IapkitStore".
14
+ * Represents the JavaScript enum/union "IapStore".
15
15
  */
16
16
  @DoNotStrip
17
17
  @Keep
18
- enum class IapkitStore(@DoNotStrip @Keep val value: Int) {
19
- APPLE(0),
20
- GOOGLE(1);
18
+ enum class IapStore(@DoNotStrip @Keep val value: Int) {
19
+ UNKNOWN(0),
20
+ APPLE(1),
21
+ GOOGLE(2),
22
+ HORIZON(3);
21
23
  }
@@ -34,6 +34,9 @@ data class NitroPurchase(
34
34
  val platform: IapPlatform,
35
35
  @DoNotStrip
36
36
  @Keep
37
+ val store: IapStore,
38
+ @DoNotStrip
39
+ @Keep
37
40
  val quantity: Double,
38
41
  @DoNotStrip
39
42
  @Keep
@@ -146,8 +149,8 @@ data class NitroPurchase(
146
149
  @Keep
147
150
  @Suppress("unused")
148
151
  @JvmStatic
149
- private fun fromCpp(id: String, productId: String, transactionDate: Double, purchaseToken: String?, platform: IapPlatform, quantity: Double, purchaseState: PurchaseState, isAutoRenewing: Boolean, quantityIOS: Double?, originalTransactionDateIOS: Double?, originalTransactionIdentifierIOS: String?, appAccountToken: String?, appBundleIdIOS: String?, countryCodeIOS: String?, currencyCodeIOS: String?, currencySymbolIOS: String?, environmentIOS: String?, expirationDateIOS: Double?, isUpgradedIOS: Boolean?, offerIOS: String?, ownershipTypeIOS: String?, reasonIOS: String?, reasonStringRepresentationIOS: String?, revocationDateIOS: Double?, revocationReasonIOS: String?, storefrontCountryCodeIOS: String?, subscriptionGroupIdIOS: String?, transactionReasonIOS: String?, webOrderLineItemIdIOS: String?, renewalInfoIOS: NitroRenewalInfoIOS?, purchaseTokenAndroid: String?, dataAndroid: String?, signatureAndroid: String?, autoRenewingAndroid: Boolean?, purchaseStateAndroid: Double?, isAcknowledgedAndroid: Boolean?, packageNameAndroid: String?, obfuscatedAccountIdAndroid: String?, obfuscatedProfileIdAndroid: String?, developerPayloadAndroid: String?): NitroPurchase {
150
- return NitroPurchase(id, productId, transactionDate, purchaseToken, platform, quantity, purchaseState, isAutoRenewing, quantityIOS, originalTransactionDateIOS, originalTransactionIdentifierIOS, appAccountToken, appBundleIdIOS, countryCodeIOS, currencyCodeIOS, currencySymbolIOS, environmentIOS, expirationDateIOS, isUpgradedIOS, offerIOS, ownershipTypeIOS, reasonIOS, reasonStringRepresentationIOS, revocationDateIOS, revocationReasonIOS, storefrontCountryCodeIOS, subscriptionGroupIdIOS, transactionReasonIOS, webOrderLineItemIdIOS, renewalInfoIOS, purchaseTokenAndroid, dataAndroid, signatureAndroid, autoRenewingAndroid, purchaseStateAndroid, isAcknowledgedAndroid, packageNameAndroid, obfuscatedAccountIdAndroid, obfuscatedProfileIdAndroid, developerPayloadAndroid)
152
+ private fun fromCpp(id: String, productId: String, transactionDate: Double, purchaseToken: String?, platform: IapPlatform, store: IapStore, quantity: Double, purchaseState: PurchaseState, isAutoRenewing: Boolean, quantityIOS: Double?, originalTransactionDateIOS: Double?, originalTransactionIdentifierIOS: String?, appAccountToken: String?, appBundleIdIOS: String?, countryCodeIOS: String?, currencyCodeIOS: String?, currencySymbolIOS: String?, environmentIOS: String?, expirationDateIOS: Double?, isUpgradedIOS: Boolean?, offerIOS: String?, ownershipTypeIOS: String?, reasonIOS: String?, reasonStringRepresentationIOS: String?, revocationDateIOS: Double?, revocationReasonIOS: String?, storefrontCountryCodeIOS: String?, subscriptionGroupIdIOS: String?, transactionReasonIOS: String?, webOrderLineItemIdIOS: String?, renewalInfoIOS: NitroRenewalInfoIOS?, purchaseTokenAndroid: String?, dataAndroid: String?, signatureAndroid: String?, autoRenewingAndroid: Boolean?, purchaseStateAndroid: Double?, isAcknowledgedAndroid: Boolean?, packageNameAndroid: String?, obfuscatedAccountIdAndroid: String?, obfuscatedProfileIdAndroid: String?, developerPayloadAndroid: String?): NitroPurchase {
153
+ return NitroPurchase(id, productId, transactionDate, purchaseToken, platform, store, quantity, purchaseState, isAutoRenewing, quantityIOS, originalTransactionDateIOS, originalTransactionIdentifierIOS, appAccountToken, appBundleIdIOS, countryCodeIOS, currencyCodeIOS, currencySymbolIOS, environmentIOS, expirationDateIOS, isUpgradedIOS, offerIOS, ownershipTypeIOS, reasonIOS, reasonStringRepresentationIOS, revocationDateIOS, revocationReasonIOS, storefrontCountryCodeIOS, subscriptionGroupIdIOS, transactionReasonIOS, webOrderLineItemIdIOS, renewalInfoIOS, purchaseTokenAndroid, dataAndroid, signatureAndroid, autoRenewingAndroid, purchaseStateAndroid, isAcknowledgedAndroid, packageNameAndroid, obfuscatedAccountIdAndroid, obfuscatedProfileIdAndroid, developerPayloadAndroid)
151
154
  }
152
155
  }
153
156
  }
@@ -22,7 +22,13 @@ data class NitroPurchaseRequest(
22
22
  val ios: NitroRequestPurchaseIos?,
23
23
  @DoNotStrip
24
24
  @Keep
25
- val android: NitroRequestPurchaseAndroid?
25
+ val android: NitroRequestPurchaseAndroid?,
26
+ @DoNotStrip
27
+ @Keep
28
+ val apple: NitroRequestPurchaseIos?,
29
+ @DoNotStrip
30
+ @Keep
31
+ val google: NitroRequestPurchaseAndroid?
26
32
  ) {
27
33
  private companion object {
28
34
  /**
@@ -32,8 +38,8 @@ data class NitroPurchaseRequest(
32
38
  @Keep
33
39
  @Suppress("unused")
34
40
  @JvmStatic
35
- private fun fromCpp(ios: NitroRequestPurchaseIos?, android: NitroRequestPurchaseAndroid?): NitroPurchaseRequest {
36
- return NitroPurchaseRequest(ios, android)
41
+ private fun fromCpp(ios: NitroRequestPurchaseIos?, android: NitroRequestPurchaseAndroid?, apple: NitroRequestPurchaseIos?, google: NitroRequestPurchaseAndroid?): NitroPurchaseRequest {
42
+ return NitroPurchaseRequest(ios, android, apple, google)
37
43
  }
38
44
  }
39
45
  }
@@ -25,7 +25,7 @@ data class NitroVerifyPurchaseWithIapkitResult(
25
25
  val state: IapkitPurchaseState,
26
26
  @DoNotStrip
27
27
  @Keep
28
- val store: IapkitStore
28
+ val store: IapStore
29
29
  ) {
30
30
  private companion object {
31
31
  /**
@@ -35,7 +35,7 @@ data class NitroVerifyPurchaseWithIapkitResult(
35
35
  @Keep
36
36
  @Suppress("unused")
37
37
  @JvmStatic
38
- private fun fromCpp(isValid: Boolean, state: IapkitPurchaseState, store: IapkitStore): NitroVerifyPurchaseWithIapkitResult {
38
+ private fun fromCpp(isValid: Boolean, state: IapkitPurchaseState, store: IapStore): NitroVerifyPurchaseWithIapkitResult {
39
39
  return NitroVerifyPurchaseWithIapkitResult(isValid, state, store)
40
40
  }
41
41
  }
@@ -0,0 +1,39 @@
1
+ ///
2
+ /// NitroVerifyPurchaseWithProviderError.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 "NitroVerifyPurchaseWithProviderError".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class NitroVerifyPurchaseWithProviderError(
20
+ @DoNotStrip
21
+ @Keep
22
+ val code: String?,
23
+ @DoNotStrip
24
+ @Keep
25
+ val message: String
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(code: String?, message: String): NitroVerifyPurchaseWithProviderError {
36
+ return NitroVerifyPurchaseWithProviderError(code, message)
37
+ }
38
+ }
39
+ }
@@ -19,7 +19,10 @@ import com.facebook.proguard.annotations.DoNotStrip
19
19
  data class NitroVerifyPurchaseWithProviderResult(
20
20
  @DoNotStrip
21
21
  @Keep
22
- val iapkit: Array<NitroVerifyPurchaseWithIapkitResult>,
22
+ val iapkit: NitroVerifyPurchaseWithIapkitResult?,
23
+ @DoNotStrip
24
+ @Keep
25
+ val errors: Array<NitroVerifyPurchaseWithProviderError>?,
23
26
  @DoNotStrip
24
27
  @Keep
25
28
  val provider: PurchaseVerificationProvider
@@ -32,8 +35,8 @@ data class NitroVerifyPurchaseWithProviderResult(
32
35
  @Keep
33
36
  @Suppress("unused")
34
37
  @JvmStatic
35
- private fun fromCpp(iapkit: Array<NitroVerifyPurchaseWithIapkitResult>, provider: PurchaseVerificationProvider): NitroVerifyPurchaseWithProviderResult {
36
- return NitroVerifyPurchaseWithProviderResult(iapkit, provider)
38
+ private fun fromCpp(iapkit: NitroVerifyPurchaseWithIapkitResult?, errors: Array<NitroVerifyPurchaseWithProviderError>?, provider: PurchaseVerificationProvider): NitroVerifyPurchaseWithProviderResult {
39
+ return NitroVerifyPurchaseWithProviderResult(iapkit, errors, provider)
37
40
  }
38
41
  }
39
42
  }
@@ -70,6 +70,9 @@ data class PurchaseAndroid(
70
70
  val signatureAndroid: String?,
71
71
  @DoNotStrip
72
72
  @Keep
73
+ val store: IapStore,
74
+ @DoNotStrip
75
+ @Keep
73
76
  val transactionDate: Double,
74
77
  @DoNotStrip
75
78
  @Keep
@@ -83,8 +86,8 @@ data class PurchaseAndroid(
83
86
  @Keep
84
87
  @Suppress("unused")
85
88
  @JvmStatic
86
- private fun fromCpp(autoRenewingAndroid: Boolean?, currentPlanId: String?, dataAndroid: String?, developerPayloadAndroid: String?, id: String, ids: Array<String>?, isAcknowledgedAndroid: Boolean?, isAutoRenewing: Boolean, obfuscatedAccountIdAndroid: String?, obfuscatedProfileIdAndroid: String?, packageNameAndroid: String?, platform: IapPlatform, productId: String, purchaseState: PurchaseState, purchaseToken: String?, quantity: Double, signatureAndroid: String?, transactionDate: Double, transactionId: String?): PurchaseAndroid {
87
- return PurchaseAndroid(autoRenewingAndroid, currentPlanId, dataAndroid, developerPayloadAndroid, id, ids, isAcknowledgedAndroid, isAutoRenewing, obfuscatedAccountIdAndroid, obfuscatedProfileIdAndroid, packageNameAndroid, platform, productId, purchaseState, purchaseToken, quantity, signatureAndroid, transactionDate, transactionId)
89
+ private fun fromCpp(autoRenewingAndroid: Boolean?, currentPlanId: String?, dataAndroid: String?, developerPayloadAndroid: String?, id: String, ids: Array<String>?, isAcknowledgedAndroid: Boolean?, isAutoRenewing: Boolean, obfuscatedAccountIdAndroid: String?, obfuscatedProfileIdAndroid: String?, packageNameAndroid: String?, platform: IapPlatform, productId: String, purchaseState: PurchaseState, purchaseToken: String?, quantity: Double, signatureAndroid: String?, store: IapStore, transactionDate: Double, transactionId: String?): PurchaseAndroid {
90
+ return PurchaseAndroid(autoRenewingAndroid, currentPlanId, dataAndroid, developerPayloadAndroid, id, ids, isAcknowledgedAndroid, isAutoRenewing, obfuscatedAccountIdAndroid, obfuscatedProfileIdAndroid, packageNameAndroid, platform, productId, purchaseState, purchaseToken, quantity, signatureAndroid, store, transactionDate, transactionId)
88
91
  }
89
92
  }
90
93
  }
@@ -100,6 +100,9 @@ data class PurchaseIOS(
100
100
  val revocationReasonIOS: String?,
101
101
  @DoNotStrip
102
102
  @Keep
103
+ val store: IapStore,
104
+ @DoNotStrip
105
+ @Keep
103
106
  val storefrontCountryCodeIOS: String?,
104
107
  @DoNotStrip
105
108
  @Keep
@@ -125,8 +128,8 @@ data class PurchaseIOS(
125
128
  @Keep
126
129
  @Suppress("unused")
127
130
  @JvmStatic
128
- private fun fromCpp(appAccountToken: String?, appBundleIdIOS: String?, countryCodeIOS: String?, currencyCodeIOS: String?, currencySymbolIOS: String?, currentPlanId: String?, environmentIOS: String?, expirationDateIOS: Double?, id: String, ids: Array<String>?, isAutoRenewing: Boolean, isUpgradedIOS: Boolean?, offerIOS: PurchaseOfferIOS?, originalTransactionDateIOS: Double?, originalTransactionIdentifierIOS: String?, ownershipTypeIOS: String?, platform: IapPlatform, productId: String, purchaseState: PurchaseState, purchaseToken: String?, quantity: Double, quantityIOS: Double?, reasonIOS: String?, reasonStringRepresentationIOS: String?, renewalInfoIOS: RenewalInfoIOS?, revocationDateIOS: Double?, revocationReasonIOS: String?, storefrontCountryCodeIOS: String?, subscriptionGroupIdIOS: String?, transactionDate: Double, transactionId: String, transactionReasonIOS: String?, webOrderLineItemIdIOS: String?): PurchaseIOS {
129
- return PurchaseIOS(appAccountToken, appBundleIdIOS, countryCodeIOS, currencyCodeIOS, currencySymbolIOS, currentPlanId, environmentIOS, expirationDateIOS, id, ids, isAutoRenewing, isUpgradedIOS, offerIOS, originalTransactionDateIOS, originalTransactionIdentifierIOS, ownershipTypeIOS, platform, productId, purchaseState, purchaseToken, quantity, quantityIOS, reasonIOS, reasonStringRepresentationIOS, renewalInfoIOS, revocationDateIOS, revocationReasonIOS, storefrontCountryCodeIOS, subscriptionGroupIdIOS, transactionDate, transactionId, transactionReasonIOS, webOrderLineItemIdIOS)
131
+ private fun fromCpp(appAccountToken: String?, appBundleIdIOS: String?, countryCodeIOS: String?, currencyCodeIOS: String?, currencySymbolIOS: String?, currentPlanId: String?, environmentIOS: String?, expirationDateIOS: Double?, id: String, ids: Array<String>?, isAutoRenewing: Boolean, isUpgradedIOS: Boolean?, offerIOS: PurchaseOfferIOS?, originalTransactionDateIOS: Double?, originalTransactionIdentifierIOS: String?, ownershipTypeIOS: String?, platform: IapPlatform, productId: String, purchaseState: PurchaseState, purchaseToken: String?, quantity: Double, quantityIOS: Double?, reasonIOS: String?, reasonStringRepresentationIOS: String?, renewalInfoIOS: RenewalInfoIOS?, revocationDateIOS: Double?, revocationReasonIOS: String?, store: IapStore, storefrontCountryCodeIOS: String?, subscriptionGroupIdIOS: String?, transactionDate: Double, transactionId: String, transactionReasonIOS: String?, webOrderLineItemIdIOS: String?): PurchaseIOS {
132
+ return PurchaseIOS(appAccountToken, appBundleIdIOS, countryCodeIOS, currencyCodeIOS, currencySymbolIOS, currentPlanId, environmentIOS, expirationDateIOS, id, ids, isAutoRenewing, isUpgradedIOS, offerIOS, originalTransactionDateIOS, originalTransactionIdentifierIOS, ownershipTypeIOS, platform, productId, purchaseState, purchaseToken, quantity, quantityIOS, reasonIOS, reasonStringRepresentationIOS, renewalInfoIOS, revocationDateIOS, revocationReasonIOS, store, storefrontCountryCodeIOS, subscriptionGroupIdIOS, transactionDate, transactionId, transactionReasonIOS, webOrderLineItemIdIOS)
130
133
  }
131
134
  }
132
135
  }
@@ -22,10 +22,10 @@ namespace margelo::nitro::iap { struct ExternalPurchaseNoticeResultIOS; }
22
22
  namespace margelo::nitro::iap { class HybridRnIapSpec; }
23
23
  // Forward declaration of `IapPlatform` to properly resolve imports.
24
24
  namespace margelo::nitro::iap { enum class IapPlatform; }
25
+ // Forward declaration of `IapStore` to properly resolve imports.
26
+ namespace margelo::nitro::iap { enum class IapStore; }
25
27
  // Forward declaration of `IapkitPurchaseState` to properly resolve imports.
26
28
  namespace margelo::nitro::iap { enum class IapkitPurchaseState; }
27
- // Forward declaration of `IapkitStore` to properly resolve imports.
28
- namespace margelo::nitro::iap { enum class IapkitStore; }
29
29
  // Forward declaration of `InitConnectionConfig` to properly resolve imports.
30
30
  namespace margelo::nitro::iap { struct InitConnectionConfig; }
31
31
  // Forward declaration of `NitroActiveSubscription` to properly resolve imports.
@@ -74,6 +74,8 @@ namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitGoogleProps;
74
74
  namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitProps; }
75
75
  // Forward declaration of `NitroVerifyPurchaseWithIapkitResult` to properly resolve imports.
76
76
  namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitResult; }
77
+ // Forward declaration of `NitroVerifyPurchaseWithProviderError` to properly resolve imports.
78
+ namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithProviderError; }
77
79
  // Forward declaration of `NitroVerifyPurchaseWithProviderResult` to properly resolve imports.
78
80
  namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithProviderResult; }
79
81
  // Forward declaration of `PaymentModeIOS` to properly resolve imports.
@@ -105,8 +107,8 @@ namespace NitroIap { class HybridRnIapSpec_cxx; }
105
107
  #include "ExternalPurchaseNoticeResultIOS.hpp"
106
108
  #include "HybridRnIapSpec.hpp"
107
109
  #include "IapPlatform.hpp"
110
+ #include "IapStore.hpp"
108
111
  #include "IapkitPurchaseState.hpp"
109
- #include "IapkitStore.hpp"
110
112
  #include "InitConnectionConfig.hpp"
111
113
  #include "NitroActiveSubscription.hpp"
112
114
  #include "NitroAvailablePurchasesAndroidOptions.hpp"
@@ -131,6 +133,7 @@ namespace NitroIap { class HybridRnIapSpec_cxx; }
131
133
  #include "NitroVerifyPurchaseWithIapkitGoogleProps.hpp"
132
134
  #include "NitroVerifyPurchaseWithIapkitProps.hpp"
133
135
  #include "NitroVerifyPurchaseWithIapkitResult.hpp"
136
+ #include "NitroVerifyPurchaseWithProviderError.hpp"
134
137
  #include "NitroVerifyPurchaseWithProviderResult.hpp"
135
138
  #include "PaymentModeIOS.hpp"
136
139
  #include "PurchaseAndroid.hpp"
@@ -1303,17 +1306,47 @@ namespace margelo::nitro::iap::bridge::swift {
1303
1306
  return *optional;
1304
1307
  }
1305
1308
 
1306
- // pragma MARK: std::vector<NitroVerifyPurchaseWithIapkitResult>
1309
+ // pragma MARK: std::optional<NitroVerifyPurchaseWithIapkitResult>
1307
1310
  /**
1308
- * Specialized version of `std::vector<NitroVerifyPurchaseWithIapkitResult>`.
1311
+ * Specialized version of `std::optional<NitroVerifyPurchaseWithIapkitResult>`.
1309
1312
  */
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
+ using std__optional_NitroVerifyPurchaseWithIapkitResult_ = std::optional<NitroVerifyPurchaseWithIapkitResult>;
1314
+ inline std::optional<NitroVerifyPurchaseWithIapkitResult> create_std__optional_NitroVerifyPurchaseWithIapkitResult_(const NitroVerifyPurchaseWithIapkitResult& value) noexcept {
1315
+ return std::optional<NitroVerifyPurchaseWithIapkitResult>(value);
1316
+ }
1317
+ inline bool has_value_std__optional_NitroVerifyPurchaseWithIapkitResult_(const std::optional<NitroVerifyPurchaseWithIapkitResult>& optional) noexcept {
1318
+ return optional.has_value();
1319
+ }
1320
+ inline NitroVerifyPurchaseWithIapkitResult get_std__optional_NitroVerifyPurchaseWithIapkitResult_(const std::optional<NitroVerifyPurchaseWithIapkitResult>& optional) noexcept {
1321
+ return *optional;
1322
+ }
1323
+
1324
+ // pragma MARK: std::vector<NitroVerifyPurchaseWithProviderError>
1325
+ /**
1326
+ * Specialized version of `std::vector<NitroVerifyPurchaseWithProviderError>`.
1327
+ */
1328
+ using std__vector_NitroVerifyPurchaseWithProviderError_ = std::vector<NitroVerifyPurchaseWithProviderError>;
1329
+ inline std::vector<NitroVerifyPurchaseWithProviderError> create_std__vector_NitroVerifyPurchaseWithProviderError_(size_t size) noexcept {
1330
+ std::vector<NitroVerifyPurchaseWithProviderError> vector;
1313
1331
  vector.reserve(size);
1314
1332
  return vector;
1315
1333
  }
1316
1334
 
1335
+ // pragma MARK: std::optional<std::vector<NitroVerifyPurchaseWithProviderError>>
1336
+ /**
1337
+ * Specialized version of `std::optional<std::vector<NitroVerifyPurchaseWithProviderError>>`.
1338
+ */
1339
+ using std__optional_std__vector_NitroVerifyPurchaseWithProviderError__ = std::optional<std::vector<NitroVerifyPurchaseWithProviderError>>;
1340
+ inline std::optional<std::vector<NitroVerifyPurchaseWithProviderError>> create_std__optional_std__vector_NitroVerifyPurchaseWithProviderError__(const std::vector<NitroVerifyPurchaseWithProviderError>& value) noexcept {
1341
+ return std::optional<std::vector<NitroVerifyPurchaseWithProviderError>>(value);
1342
+ }
1343
+ inline bool has_value_std__optional_std__vector_NitroVerifyPurchaseWithProviderError__(const std::optional<std::vector<NitroVerifyPurchaseWithProviderError>>& optional) noexcept {
1344
+ return optional.has_value();
1345
+ }
1346
+ inline std::vector<NitroVerifyPurchaseWithProviderError> get_std__optional_std__vector_NitroVerifyPurchaseWithProviderError__(const std::optional<std::vector<NitroVerifyPurchaseWithProviderError>>& optional) noexcept {
1347
+ return *optional;
1348
+ }
1349
+
1317
1350
  // pragma MARK: std::shared_ptr<Promise<NitroVerifyPurchaseWithProviderResult>>
1318
1351
  /**
1319
1352
  * Specialized version of `std::shared_ptr<Promise<NitroVerifyPurchaseWithProviderResult>>`.
@@ -22,10 +22,10 @@ namespace margelo::nitro::iap { struct ExternalPurchaseNoticeResultIOS; }
22
22
  namespace margelo::nitro::iap { class HybridRnIapSpec; }
23
23
  // Forward declaration of `IapPlatform` to properly resolve imports.
24
24
  namespace margelo::nitro::iap { enum class IapPlatform; }
25
+ // Forward declaration of `IapStore` to properly resolve imports.
26
+ namespace margelo::nitro::iap { enum class IapStore; }
25
27
  // Forward declaration of `IapkitPurchaseState` to properly resolve imports.
26
28
  namespace margelo::nitro::iap { enum class IapkitPurchaseState; }
27
- // Forward declaration of `IapkitStore` to properly resolve imports.
28
- namespace margelo::nitro::iap { enum class IapkitStore; }
29
29
  // Forward declaration of `InitConnectionConfig` to properly resolve imports.
30
30
  namespace margelo::nitro::iap { struct InitConnectionConfig; }
31
31
  // Forward declaration of `NitroActiveSubscription` to properly resolve imports.
@@ -82,6 +82,8 @@ namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitGoogleProps;
82
82
  namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitProps; }
83
83
  // Forward declaration of `NitroVerifyPurchaseWithIapkitResult` to properly resolve imports.
84
84
  namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitResult; }
85
+ // Forward declaration of `NitroVerifyPurchaseWithProviderError` to properly resolve imports.
86
+ namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithProviderError; }
85
87
  // Forward declaration of `NitroVerifyPurchaseWithProviderProps` to properly resolve imports.
86
88
  namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithProviderProps; }
87
89
  // Forward declaration of `NitroVerifyPurchaseWithProviderResult` to properly resolve imports.
@@ -111,8 +113,8 @@ namespace margelo::nitro::iap { struct UserChoiceBillingDetails; }
111
113
  #include "ExternalPurchaseNoticeResultIOS.hpp"
112
114
  #include "HybridRnIapSpec.hpp"
113
115
  #include "IapPlatform.hpp"
116
+ #include "IapStore.hpp"
114
117
  #include "IapkitPurchaseState.hpp"
115
- #include "IapkitStore.hpp"
116
118
  #include "InitConnectionConfig.hpp"
117
119
  #include "NitroActiveSubscription.hpp"
118
120
  #include "NitroAvailablePurchasesAndroidOptions.hpp"
@@ -141,6 +143,7 @@ namespace margelo::nitro::iap { struct UserChoiceBillingDetails; }
141
143
  #include "NitroVerifyPurchaseWithIapkitGoogleProps.hpp"
142
144
  #include "NitroVerifyPurchaseWithIapkitProps.hpp"
143
145
  #include "NitroVerifyPurchaseWithIapkitResult.hpp"
146
+ #include "NitroVerifyPurchaseWithProviderError.hpp"
144
147
  #include "NitroVerifyPurchaseWithProviderProps.hpp"
145
148
  #include "NitroVerifyPurchaseWithProviderResult.hpp"
146
149
  #include "PaymentModeIOS.hpp"
@@ -30,6 +30,8 @@ namespace margelo::nitro::iap { struct PurchaseAndroid; }
30
30
  namespace margelo::nitro::iap { struct PurchaseIOS; }
31
31
  // Forward declaration of `PurchaseState` to properly resolve imports.
32
32
  namespace margelo::nitro::iap { enum class PurchaseState; }
33
+ // Forward declaration of `IapStore` to properly resolve imports.
34
+ namespace margelo::nitro::iap { enum class IapStore; }
33
35
  // Forward declaration of `PurchaseOfferIOS` to properly resolve imports.
34
36
  namespace margelo::nitro::iap { struct PurchaseOfferIOS; }
35
37
  // Forward declaration of `RenewalInfoIOS` to properly resolve imports.
@@ -82,8 +84,8 @@ namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithProviderResult; }
82
84
  namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitResult; }
83
85
  // Forward declaration of `IapkitPurchaseState` to properly resolve imports.
84
86
  namespace margelo::nitro::iap { enum class IapkitPurchaseState; }
85
- // Forward declaration of `IapkitStore` to properly resolve imports.
86
- namespace margelo::nitro::iap { enum class IapkitStore; }
87
+ // Forward declaration of `NitroVerifyPurchaseWithProviderError` to properly resolve imports.
88
+ namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithProviderError; }
87
89
  // Forward declaration of `PurchaseVerificationProvider` to properly resolve imports.
88
90
  namespace margelo::nitro::iap { enum class PurchaseVerificationProvider; }
89
91
  // Forward declaration of `NitroVerifyPurchaseWithProviderProps` to properly resolve imports.
@@ -119,6 +121,7 @@ namespace margelo::nitro::iap { struct ExternalPurchaseLinkResultIOS; }
119
121
  #include "PurchaseIOS.hpp"
120
122
  #include <variant>
121
123
  #include "PurchaseState.hpp"
124
+ #include "IapStore.hpp"
122
125
  #include "PurchaseOfferIOS.hpp"
123
126
  #include "RenewalInfoIOS.hpp"
124
127
  #include "NitroPurchaseRequest.hpp"
@@ -147,7 +150,7 @@ namespace margelo::nitro::iap { struct ExternalPurchaseLinkResultIOS; }
147
150
  #include "NitroVerifyPurchaseWithProviderResult.hpp"
148
151
  #include "NitroVerifyPurchaseWithIapkitResult.hpp"
149
152
  #include "IapkitPurchaseState.hpp"
150
- #include "IapkitStore.hpp"
153
+ #include "NitroVerifyPurchaseWithProviderError.hpp"
151
154
  #include "PurchaseVerificationProvider.hpp"
152
155
  #include "NitroVerifyPurchaseWithProviderProps.hpp"
153
156
  #include "NitroVerifyPurchaseWithIapkitProps.hpp"
@@ -1,40 +1,48 @@
1
1
  ///
2
- /// IapkitStore.swift
2
+ /// IapStore.swift
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
6
6
  ///
7
7
 
8
8
  /**
9
- * Represents the JS union `IapkitStore`, backed by a C++ enum.
9
+ * Represents the JS union `IapStore`, backed by a C++ enum.
10
10
  */
11
- public typealias IapkitStore = margelo.nitro.iap.IapkitStore
11
+ public typealias IapStore = margelo.nitro.iap.IapStore
12
12
 
13
- public extension IapkitStore {
13
+ public extension IapStore {
14
14
  /**
15
- * Get a IapkitStore for the given String value, or
15
+ * Get a IapStore for the given String value, or
16
16
  * return `nil` if the given value was invalid/unknown.
17
17
  */
18
18
  init?(fromString string: String) {
19
19
  switch string {
20
+ case "unknown":
21
+ self = .unknown
20
22
  case "apple":
21
23
  self = .apple
22
24
  case "google":
23
25
  self = .google
26
+ case "horizon":
27
+ self = .horizon
24
28
  default:
25
29
  return nil
26
30
  }
27
31
  }
28
32
 
29
33
  /**
30
- * Get the String value this IapkitStore represents.
34
+ * Get the String value this IapStore represents.
31
35
  */
32
36
  var stringValue: String {
33
37
  switch self {
38
+ case .unknown:
39
+ return "unknown"
34
40
  case .apple:
35
41
  return "apple"
36
42
  case .google:
37
43
  return "google"
44
+ case .horizon:
45
+ return "horizon"
38
46
  }
39
47
  }
40
48
  }