react-native-iap 14.7.1 → 14.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +151 -7
- package/ios/HybridRnIap.swift +13 -0
- package/ios/RnIapHelper.swift +24 -0
- package/lib/module/types.js +94 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/type-bridge.js +52 -1
- package/lib/module/utils/type-bridge.js.map +1 -1
- package/lib/typescript/src/specs/RnIap.nitro.d.ts +47 -1
- package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +350 -4
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/type-bridge.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +16 -0
- package/nitrogen/generated/android/c++/JNitroAvailablePurchasesAndroidOptions.hpp +7 -3
- package/nitrogen/generated/android/c++/JNitroAvailablePurchasesIosOptions.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroProduct.hpp +15 -3
- package/nitrogen/generated/android/c++/JNitroPurchaseRequest.hpp +8 -0
- package/nitrogen/generated/android/c++/JNitroRequestPurchaseAndroid.hpp +11 -3
- package/nitrogen/generated/android/c++/JNitroRequestPurchaseIos.hpp +19 -3
- package/nitrogen/generated/android/c++/JPromotionalOfferJwsInputIOS.hpp +61 -0
- package/nitrogen/generated/android/c++/JSubscriptionProductReplacementParamsAndroid.hpp +63 -0
- package/nitrogen/generated/android/c++/JSubscriptionReplacementModeAndroid.hpp +74 -0
- package/nitrogen/generated/android/c++/JWinBackOfferInputIOS.hpp +57 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesAndroidOptions.kt +6 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesIosOptions.kt +5 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroProduct.kt +12 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRequestPurchaseAndroid.kt +6 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRequestPurchaseIos.kt +12 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PromotionalOfferJwsInputIOS.kt +39 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/SubscriptionProductReplacementParamsAndroid.kt +39 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/SubscriptionReplacementModeAndroid.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/WinBackOfferInputIOS.kt +36 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +57 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +12 -0
- package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +12 -0
- package/nitrogen/generated/ios/swift/NitroAvailablePurchasesAndroidOptions.swift +31 -1
- package/nitrogen/generated/ios/swift/NitroAvailablePurchasesIosOptions.swift +31 -1
- package/nitrogen/generated/ios/swift/NitroProduct.swift +91 -1
- package/nitrogen/generated/ios/swift/NitroRequestPurchaseAndroid.swift +24 -1
- package/nitrogen/generated/ios/swift/NitroRequestPurchaseIos.swift +77 -1
- package/nitrogen/generated/ios/swift/PromotionalOfferJwsInputIOS.swift +46 -0
- package/nitrogen/generated/ios/swift/SubscriptionProductReplacementParamsAndroid.swift +46 -0
- package/nitrogen/generated/ios/swift/SubscriptionReplacementModeAndroid.swift +60 -0
- package/nitrogen/generated/ios/swift/WinBackOfferInputIOS.swift +35 -0
- package/nitrogen/generated/shared/c++/NitroAvailablePurchasesAndroidOptions.hpp +6 -2
- package/nitrogen/generated/shared/c++/NitroAvailablePurchasesIosOptions.hpp +5 -1
- package/nitrogen/generated/shared/c++/NitroProduct.hpp +14 -2
- package/nitrogen/generated/shared/c++/NitroRequestPurchaseAndroid.hpp +9 -2
- package/nitrogen/generated/shared/c++/NitroRequestPurchaseIos.hpp +20 -3
- package/nitrogen/generated/shared/c++/PromotionalOfferJwsInputIOS.hpp +79 -0
- package/nitrogen/generated/shared/c++/SubscriptionProductReplacementParamsAndroid.hpp +81 -0
- package/nitrogen/generated/shared/c++/SubscriptionReplacementModeAndroid.hpp +96 -0
- package/nitrogen/generated/shared/c++/WinBackOfferInputIOS.hpp +75 -0
- package/openiap-versions.json +4 -4
- package/package.json +1 -1
- package/src/specs/RnIap.nitro.ts +50 -0
- package/src/types.ts +360 -4
- package/src/utils/type-bridge.ts +55 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-bridge.d.ts","sourceRoot":"","sources":["../../../../src/utils/type-bridge.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,uBAAuB,EACxB,MAAM,sBAAsB,CAAC;AAU9B,OAAO,KAAK,EACV,OAAO,EACP,mBAAmB,EACnB,QAAQ,EAGR,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAwLlB;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,YAAY,EAAE,YAAY,GACzB,OAAO,
|
|
1
|
+
{"version":3,"file":"type-bridge.d.ts","sourceRoot":"","sources":["../../../../src/utils/type-bridge.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,uBAAuB,EACxB,MAAM,sBAAsB,CAAC;AAU9B,OAAO,KAAK,EACV,OAAO,EACP,mBAAmB,EACnB,QAAQ,EAGR,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAwLlB;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,YAAY,EAAE,YAAY,GACzB,OAAO,CAyIT;AAED;;GAEG;AACH,wBAAgB,mCAAmC,CACjD,OAAO,EAAE,OAAO,GACf,mBAAmB,CAiBrB;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,aAAa,EAAE,aAAa,GAC3B,QAAQ,CAmJV;AAED;;GAEG;AACH,wBAAgB,qDAAqD,CACnE,KAAK,EAAE,uBAAuB,GAC7B,qBAAqB,CAavB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAoBxE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAoB3E;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI;IAC1C,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CA4BA"}
|
|
@@ -85,10 +85,18 @@ namespace margelo::nitro::iap { enum class AlternativeBillingModeAndroid; }
|
|
|
85
85
|
namespace margelo::nitro::iap { struct NitroPurchaseRequest; }
|
|
86
86
|
// Forward declaration of `NitroRequestPurchaseIos` to properly resolve imports.
|
|
87
87
|
namespace margelo::nitro::iap { struct NitroRequestPurchaseIos; }
|
|
88
|
+
// Forward declaration of `PromotionalOfferJwsInputIOS` to properly resolve imports.
|
|
89
|
+
namespace margelo::nitro::iap { struct PromotionalOfferJwsInputIOS; }
|
|
90
|
+
// Forward declaration of `WinBackOfferInputIOS` to properly resolve imports.
|
|
91
|
+
namespace margelo::nitro::iap { struct WinBackOfferInputIOS; }
|
|
88
92
|
// Forward declaration of `NitroRequestPurchaseAndroid` to properly resolve imports.
|
|
89
93
|
namespace margelo::nitro::iap { struct NitroRequestPurchaseAndroid; }
|
|
90
94
|
// Forward declaration of `AndroidSubscriptionOfferInput` to properly resolve imports.
|
|
91
95
|
namespace margelo::nitro::iap { struct AndroidSubscriptionOfferInput; }
|
|
96
|
+
// Forward declaration of `SubscriptionProductReplacementParamsAndroid` to properly resolve imports.
|
|
97
|
+
namespace margelo::nitro::iap { struct SubscriptionProductReplacementParamsAndroid; }
|
|
98
|
+
// Forward declaration of `SubscriptionReplacementModeAndroid` to properly resolve imports.
|
|
99
|
+
namespace margelo::nitro::iap { enum class SubscriptionReplacementModeAndroid; }
|
|
92
100
|
// Forward declaration of `NitroAvailablePurchasesOptions` to properly resolve imports.
|
|
93
101
|
namespace margelo::nitro::iap { struct NitroAvailablePurchasesOptions; }
|
|
94
102
|
// Forward declaration of `NitroAvailablePurchasesIosOptions` to properly resolve imports.
|
|
@@ -221,10 +229,18 @@ namespace margelo::nitro::iap { enum class ExternalLinkTypeAndroid; }
|
|
|
221
229
|
#include "NitroRequestPurchaseIos.hpp"
|
|
222
230
|
#include "JNitroRequestPurchaseIos.hpp"
|
|
223
231
|
#include <unordered_map>
|
|
232
|
+
#include "PromotionalOfferJwsInputIOS.hpp"
|
|
233
|
+
#include "JPromotionalOfferJwsInputIOS.hpp"
|
|
234
|
+
#include "WinBackOfferInputIOS.hpp"
|
|
235
|
+
#include "JWinBackOfferInputIOS.hpp"
|
|
224
236
|
#include "NitroRequestPurchaseAndroid.hpp"
|
|
225
237
|
#include "JNitroRequestPurchaseAndroid.hpp"
|
|
226
238
|
#include "AndroidSubscriptionOfferInput.hpp"
|
|
227
239
|
#include "JAndroidSubscriptionOfferInput.hpp"
|
|
240
|
+
#include "SubscriptionProductReplacementParamsAndroid.hpp"
|
|
241
|
+
#include "JSubscriptionProductReplacementParamsAndroid.hpp"
|
|
242
|
+
#include "SubscriptionReplacementModeAndroid.hpp"
|
|
243
|
+
#include "JSubscriptionReplacementModeAndroid.hpp"
|
|
228
244
|
#include "NitroAvailablePurchasesOptions.hpp"
|
|
229
245
|
#include "JNitroAvailablePurchasesOptions.hpp"
|
|
230
246
|
#include "NitroAvailablePurchasesIosOptions.hpp"
|
|
@@ -35,8 +35,11 @@ namespace margelo::nitro::iap {
|
|
|
35
35
|
static const auto clazz = javaClassStatic();
|
|
36
36
|
static const auto fieldType = clazz->getField<JNitroAvailablePurchasesAndroidType>("type");
|
|
37
37
|
jni::local_ref<JNitroAvailablePurchasesAndroidType> type = this->getFieldValue(fieldType);
|
|
38
|
+
static const auto fieldIncludeSuspended = clazz->getField<jni::JBoolean>("includeSuspended");
|
|
39
|
+
jni::local_ref<jni::JBoolean> includeSuspended = this->getFieldValue(fieldIncludeSuspended);
|
|
38
40
|
return NitroAvailablePurchasesAndroidOptions(
|
|
39
|
-
type != nullptr ? std::make_optional(type->toCpp()) : std::nullopt
|
|
41
|
+
type != nullptr ? std::make_optional(type->toCpp()) : std::nullopt,
|
|
42
|
+
includeSuspended != nullptr ? std::make_optional(static_cast<bool>(includeSuspended->value())) : std::nullopt
|
|
40
43
|
);
|
|
41
44
|
}
|
|
42
45
|
|
|
@@ -46,12 +49,13 @@ namespace margelo::nitro::iap {
|
|
|
46
49
|
*/
|
|
47
50
|
[[maybe_unused]]
|
|
48
51
|
static jni::local_ref<JNitroAvailablePurchasesAndroidOptions::javaobject> fromCpp(const NitroAvailablePurchasesAndroidOptions& value) {
|
|
49
|
-
using JSignature = JNitroAvailablePurchasesAndroidOptions(jni::alias_ref<JNitroAvailablePurchasesAndroidType>);
|
|
52
|
+
using JSignature = JNitroAvailablePurchasesAndroidOptions(jni::alias_ref<JNitroAvailablePurchasesAndroidType>, jni::alias_ref<jni::JBoolean>);
|
|
50
53
|
static const auto clazz = javaClassStatic();
|
|
51
54
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
52
55
|
return create(
|
|
53
56
|
clazz,
|
|
54
|
-
value.type.has_value() ? JNitroAvailablePurchasesAndroidType::fromCpp(value.type.value()) : nullptr
|
|
57
|
+
value.type.has_value() ? JNitroAvailablePurchasesAndroidType::fromCpp(value.type.value()) : nullptr,
|
|
58
|
+
value.includeSuspended.has_value() ? jni::JBoolean::valueOf(value.includeSuspended.value()) : nullptr
|
|
55
59
|
);
|
|
56
60
|
}
|
|
57
61
|
};
|
|
@@ -37,12 +37,15 @@ namespace margelo::nitro::iap {
|
|
|
37
37
|
jni::local_ref<jni::JBoolean> onlyIncludeActiveItems = this->getFieldValue(fieldOnlyIncludeActiveItems);
|
|
38
38
|
static const auto fieldAlsoPublishToEventListenerIOS = clazz->getField<jni::JBoolean>("alsoPublishToEventListenerIOS");
|
|
39
39
|
jni::local_ref<jni::JBoolean> alsoPublishToEventListenerIOS = this->getFieldValue(fieldAlsoPublishToEventListenerIOS);
|
|
40
|
+
static const auto fieldIncludeSuspendedAndroid = clazz->getField<jni::JBoolean>("includeSuspendedAndroid");
|
|
41
|
+
jni::local_ref<jni::JBoolean> includeSuspendedAndroid = this->getFieldValue(fieldIncludeSuspendedAndroid);
|
|
40
42
|
static const auto fieldOnlyIncludeActiveItemsIOS = clazz->getField<jni::JBoolean>("onlyIncludeActiveItemsIOS");
|
|
41
43
|
jni::local_ref<jni::JBoolean> onlyIncludeActiveItemsIOS = this->getFieldValue(fieldOnlyIncludeActiveItemsIOS);
|
|
42
44
|
return NitroAvailablePurchasesIosOptions(
|
|
43
45
|
alsoPublishToEventListener != nullptr ? std::make_optional(static_cast<bool>(alsoPublishToEventListener->value())) : std::nullopt,
|
|
44
46
|
onlyIncludeActiveItems != nullptr ? std::make_optional(static_cast<bool>(onlyIncludeActiveItems->value())) : std::nullopt,
|
|
45
47
|
alsoPublishToEventListenerIOS != nullptr ? std::make_optional(static_cast<bool>(alsoPublishToEventListenerIOS->value())) : std::nullopt,
|
|
48
|
+
includeSuspendedAndroid != nullptr ? std::make_optional(static_cast<bool>(includeSuspendedAndroid->value())) : std::nullopt,
|
|
46
49
|
onlyIncludeActiveItemsIOS != nullptr ? std::make_optional(static_cast<bool>(onlyIncludeActiveItemsIOS->value())) : std::nullopt
|
|
47
50
|
);
|
|
48
51
|
}
|
|
@@ -53,7 +56,7 @@ namespace margelo::nitro::iap {
|
|
|
53
56
|
*/
|
|
54
57
|
[[maybe_unused]]
|
|
55
58
|
static jni::local_ref<JNitroAvailablePurchasesIosOptions::javaobject> fromCpp(const NitroAvailablePurchasesIosOptions& value) {
|
|
56
|
-
using JSignature = JNitroAvailablePurchasesIosOptions(jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>);
|
|
59
|
+
using JSignature = JNitroAvailablePurchasesIosOptions(jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>);
|
|
57
60
|
static const auto clazz = javaClassStatic();
|
|
58
61
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
59
62
|
return create(
|
|
@@ -61,6 +64,7 @@ namespace margelo::nitro::iap {
|
|
|
61
64
|
value.alsoPublishToEventListener.has_value() ? jni::JBoolean::valueOf(value.alsoPublishToEventListener.value()) : nullptr,
|
|
62
65
|
value.onlyIncludeActiveItems.has_value() ? jni::JBoolean::valueOf(value.onlyIncludeActiveItems.value()) : nullptr,
|
|
63
66
|
value.alsoPublishToEventListenerIOS.has_value() ? jni::JBoolean::valueOf(value.alsoPublishToEventListenerIOS.value()) : nullptr,
|
|
67
|
+
value.includeSuspendedAndroid.has_value() ? jni::JBoolean::valueOf(value.includeSuspendedAndroid.value()) : nullptr,
|
|
64
68
|
value.onlyIncludeActiveItemsIOS.has_value() ? jni::JBoolean::valueOf(value.onlyIncludeActiveItemsIOS.value()) : nullptr
|
|
65
69
|
);
|
|
66
70
|
}
|
|
@@ -91,6 +91,10 @@ namespace margelo::nitro::iap {
|
|
|
91
91
|
jni::local_ref<jni::JDouble> subscriptionPeriodNumberIOS = this->getFieldValue(fieldSubscriptionPeriodNumberIOS);
|
|
92
92
|
static const auto fieldSubscriptionPeriodUnitIOS = clazz->getField<jni::JString>("subscriptionPeriodUnitIOS");
|
|
93
93
|
jni::local_ref<jni::JString> subscriptionPeriodUnitIOS = this->getFieldValue(fieldSubscriptionPeriodUnitIOS);
|
|
94
|
+
static const auto fieldSubscriptionOffers = clazz->getField<jni::JString>("subscriptionOffers");
|
|
95
|
+
jni::local_ref<jni::JString> subscriptionOffers = this->getFieldValue(fieldSubscriptionOffers);
|
|
96
|
+
static const auto fieldDiscountOffers = clazz->getField<jni::JString>("discountOffers");
|
|
97
|
+
jni::local_ref<jni::JString> discountOffers = this->getFieldValue(fieldDiscountOffers);
|
|
94
98
|
static const auto fieldNameAndroid = clazz->getField<jni::JString>("nameAndroid");
|
|
95
99
|
jni::local_ref<jni::JString> nameAndroid = this->getFieldValue(fieldNameAndroid);
|
|
96
100
|
static const auto fieldOriginalPriceAndroid = clazz->getField<jni::JString>("originalPriceAndroid");
|
|
@@ -111,6 +115,8 @@ namespace margelo::nitro::iap {
|
|
|
111
115
|
jni::local_ref<jni::JString> subscriptionOfferDetailsAndroid = this->getFieldValue(fieldSubscriptionOfferDetailsAndroid);
|
|
112
116
|
static const auto fieldOneTimePurchaseOfferDetailsAndroid = clazz->getField<jni::JArrayClass<JNitroOneTimePurchaseOfferDetail>>("oneTimePurchaseOfferDetailsAndroid");
|
|
113
117
|
jni::local_ref<jni::JArrayClass<JNitroOneTimePurchaseOfferDetail>> oneTimePurchaseOfferDetailsAndroid = this->getFieldValue(fieldOneTimePurchaseOfferDetailsAndroid);
|
|
118
|
+
static const auto fieldProductStatusAndroid = clazz->getField<jni::JString>("productStatusAndroid");
|
|
119
|
+
jni::local_ref<jni::JString> productStatusAndroid = this->getFieldValue(fieldProductStatusAndroid);
|
|
114
120
|
return NitroProduct(
|
|
115
121
|
id->toStdString(),
|
|
116
122
|
title->toStdString(),
|
|
@@ -132,6 +138,8 @@ namespace margelo::nitro::iap {
|
|
|
132
138
|
introductoryPriceSubscriptionPeriodIOS != nullptr ? std::make_optional(introductoryPriceSubscriptionPeriodIOS->toStdString()) : std::nullopt,
|
|
133
139
|
subscriptionPeriodNumberIOS != nullptr ? std::make_optional(subscriptionPeriodNumberIOS->value()) : std::nullopt,
|
|
134
140
|
subscriptionPeriodUnitIOS != nullptr ? std::make_optional(subscriptionPeriodUnitIOS->toStdString()) : std::nullopt,
|
|
141
|
+
subscriptionOffers != nullptr ? std::make_optional(subscriptionOffers->toStdString()) : std::nullopt,
|
|
142
|
+
discountOffers != nullptr ? std::make_optional(discountOffers->toStdString()) : std::nullopt,
|
|
135
143
|
nameAndroid != nullptr ? std::make_optional(nameAndroid->toStdString()) : std::nullopt,
|
|
136
144
|
originalPriceAndroid != nullptr ? std::make_optional(originalPriceAndroid->toStdString()) : std::nullopt,
|
|
137
145
|
originalPriceAmountMicrosAndroid != nullptr ? std::make_optional(originalPriceAmountMicrosAndroid->value()) : std::nullopt,
|
|
@@ -150,7 +158,8 @@ namespace margelo::nitro::iap {
|
|
|
150
158
|
__vector.push_back(__element->toCpp());
|
|
151
159
|
}
|
|
152
160
|
return __vector;
|
|
153
|
-
}()) : std::nullopt
|
|
161
|
+
}()) : std::nullopt,
|
|
162
|
+
productStatusAndroid != nullptr ? std::make_optional(productStatusAndroid->toStdString()) : std::nullopt
|
|
154
163
|
);
|
|
155
164
|
}
|
|
156
165
|
|
|
@@ -160,7 +169,7 @@ namespace margelo::nitro::iap {
|
|
|
160
169
|
*/
|
|
161
170
|
[[maybe_unused]]
|
|
162
171
|
static jni::local_ref<JNitroProduct::javaobject> fromCpp(const NitroProduct& value) {
|
|
163
|
-
using JSignature = JNitroProduct(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<JIapPlatform>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<JPaymentModeIOS>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JArrayClass<JNitroOneTimePurchaseOfferDetail
|
|
172
|
+
using JSignature = JNitroProduct(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<JIapPlatform>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<JPaymentModeIOS>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JDouble>, 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::JDouble>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JArrayClass<JNitroOneTimePurchaseOfferDetail>>, jni::alias_ref<jni::JString>);
|
|
164
173
|
static const auto clazz = javaClassStatic();
|
|
165
174
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
166
175
|
return create(
|
|
@@ -185,6 +194,8 @@ namespace margelo::nitro::iap {
|
|
|
185
194
|
value.introductoryPriceSubscriptionPeriodIOS.has_value() ? jni::make_jstring(value.introductoryPriceSubscriptionPeriodIOS.value()) : nullptr,
|
|
186
195
|
value.subscriptionPeriodNumberIOS.has_value() ? jni::JDouble::valueOf(value.subscriptionPeriodNumberIOS.value()) : nullptr,
|
|
187
196
|
value.subscriptionPeriodUnitIOS.has_value() ? jni::make_jstring(value.subscriptionPeriodUnitIOS.value()) : nullptr,
|
|
197
|
+
value.subscriptionOffers.has_value() ? jni::make_jstring(value.subscriptionOffers.value()) : nullptr,
|
|
198
|
+
value.discountOffers.has_value() ? jni::make_jstring(value.discountOffers.value()) : nullptr,
|
|
188
199
|
value.nameAndroid.has_value() ? jni::make_jstring(value.nameAndroid.value()) : nullptr,
|
|
189
200
|
value.originalPriceAndroid.has_value() ? jni::make_jstring(value.originalPriceAndroid.value()) : nullptr,
|
|
190
201
|
value.originalPriceAmountMicrosAndroid.has_value() ? jni::JDouble::valueOf(value.originalPriceAmountMicrosAndroid.value()) : nullptr,
|
|
@@ -202,7 +213,8 @@ namespace margelo::nitro::iap {
|
|
|
202
213
|
__array->setElement(__i, *JNitroOneTimePurchaseOfferDetail::fromCpp(__element));
|
|
203
214
|
}
|
|
204
215
|
return __array;
|
|
205
|
-
}() : nullptr
|
|
216
|
+
}() : nullptr,
|
|
217
|
+
value.productStatusAndroid.has_value() ? jni::make_jstring(value.productStatusAndroid.value()) : nullptr
|
|
206
218
|
);
|
|
207
219
|
}
|
|
208
220
|
};
|
|
@@ -14,8 +14,16 @@
|
|
|
14
14
|
#include "JAndroidSubscriptionOfferInput.hpp"
|
|
15
15
|
#include "JNitroRequestPurchaseAndroid.hpp"
|
|
16
16
|
#include "JNitroRequestPurchaseIos.hpp"
|
|
17
|
+
#include "JPromotionalOfferJwsInputIOS.hpp"
|
|
18
|
+
#include "JSubscriptionProductReplacementParamsAndroid.hpp"
|
|
19
|
+
#include "JSubscriptionReplacementModeAndroid.hpp"
|
|
20
|
+
#include "JWinBackOfferInputIOS.hpp"
|
|
17
21
|
#include "NitroRequestPurchaseAndroid.hpp"
|
|
18
22
|
#include "NitroRequestPurchaseIos.hpp"
|
|
23
|
+
#include "PromotionalOfferJwsInputIOS.hpp"
|
|
24
|
+
#include "SubscriptionProductReplacementParamsAndroid.hpp"
|
|
25
|
+
#include "SubscriptionReplacementModeAndroid.hpp"
|
|
26
|
+
#include "WinBackOfferInputIOS.hpp"
|
|
19
27
|
#include <optional>
|
|
20
28
|
#include <string>
|
|
21
29
|
#include <unordered_map>
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
|
|
13
13
|
#include "AndroidSubscriptionOfferInput.hpp"
|
|
14
14
|
#include "JAndroidSubscriptionOfferInput.hpp"
|
|
15
|
+
#include "JSubscriptionProductReplacementParamsAndroid.hpp"
|
|
16
|
+
#include "JSubscriptionReplacementModeAndroid.hpp"
|
|
17
|
+
#include "SubscriptionProductReplacementParamsAndroid.hpp"
|
|
18
|
+
#include "SubscriptionReplacementModeAndroid.hpp"
|
|
15
19
|
#include <optional>
|
|
16
20
|
#include <string>
|
|
17
21
|
#include <vector>
|
|
@@ -49,6 +53,8 @@ namespace margelo::nitro::iap {
|
|
|
49
53
|
jni::local_ref<jni::JDouble> replacementModeAndroid = this->getFieldValue(fieldReplacementModeAndroid);
|
|
50
54
|
static const auto fieldPurchaseTokenAndroid = clazz->getField<jni::JString>("purchaseTokenAndroid");
|
|
51
55
|
jni::local_ref<jni::JString> purchaseTokenAndroid = this->getFieldValue(fieldPurchaseTokenAndroid);
|
|
56
|
+
static const auto fieldSubscriptionProductReplacementParams = clazz->getField<JSubscriptionProductReplacementParamsAndroid>("subscriptionProductReplacementParams");
|
|
57
|
+
jni::local_ref<JSubscriptionProductReplacementParamsAndroid> subscriptionProductReplacementParams = this->getFieldValue(fieldSubscriptionProductReplacementParams);
|
|
52
58
|
return NitroRequestPurchaseAndroid(
|
|
53
59
|
[&]() {
|
|
54
60
|
size_t __size = skus->size();
|
|
@@ -74,7 +80,8 @@ namespace margelo::nitro::iap {
|
|
|
74
80
|
return __vector;
|
|
75
81
|
}()) : std::nullopt,
|
|
76
82
|
replacementModeAndroid != nullptr ? std::make_optional(replacementModeAndroid->value()) : std::nullopt,
|
|
77
|
-
purchaseTokenAndroid != nullptr ? std::make_optional(purchaseTokenAndroid->toStdString()) : std::nullopt
|
|
83
|
+
purchaseTokenAndroid != nullptr ? std::make_optional(purchaseTokenAndroid->toStdString()) : std::nullopt,
|
|
84
|
+
subscriptionProductReplacementParams != nullptr ? std::make_optional(subscriptionProductReplacementParams->toCpp()) : std::nullopt
|
|
78
85
|
);
|
|
79
86
|
}
|
|
80
87
|
|
|
@@ -84,7 +91,7 @@ namespace margelo::nitro::iap {
|
|
|
84
91
|
*/
|
|
85
92
|
[[maybe_unused]]
|
|
86
93
|
static jni::local_ref<JNitroRequestPurchaseAndroid::javaobject> fromCpp(const NitroRequestPurchaseAndroid& value) {
|
|
87
|
-
using JSignature = JNitroRequestPurchaseAndroid(jni::alias_ref<jni::JArrayClass<jni::JString>>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JArrayClass<JAndroidSubscriptionOfferInput>>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JString>);
|
|
94
|
+
using JSignature = JNitroRequestPurchaseAndroid(jni::alias_ref<jni::JArrayClass<jni::JString>>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JArrayClass<JAndroidSubscriptionOfferInput>>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JString>, jni::alias_ref<JSubscriptionProductReplacementParamsAndroid>);
|
|
88
95
|
static const auto clazz = javaClassStatic();
|
|
89
96
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
90
97
|
return create(
|
|
@@ -111,7 +118,8 @@ namespace margelo::nitro::iap {
|
|
|
111
118
|
return __array;
|
|
112
119
|
}() : nullptr,
|
|
113
120
|
value.replacementModeAndroid.has_value() ? jni::JDouble::valueOf(value.replacementModeAndroid.value()) : nullptr,
|
|
114
|
-
value.purchaseTokenAndroid.has_value() ? jni::make_jstring(value.purchaseTokenAndroid.value()) : nullptr
|
|
121
|
+
value.purchaseTokenAndroid.has_value() ? jni::make_jstring(value.purchaseTokenAndroid.value()) : nullptr,
|
|
122
|
+
value.subscriptionProductReplacementParams.has_value() ? JSubscriptionProductReplacementParamsAndroid::fromCpp(value.subscriptionProductReplacementParams.value()) : nullptr
|
|
115
123
|
);
|
|
116
124
|
}
|
|
117
125
|
};
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
#include <fbjni/fbjni.h>
|
|
11
11
|
#include "NitroRequestPurchaseIos.hpp"
|
|
12
12
|
|
|
13
|
+
#include "JPromotionalOfferJwsInputIOS.hpp"
|
|
14
|
+
#include "JWinBackOfferInputIOS.hpp"
|
|
15
|
+
#include "PromotionalOfferJwsInputIOS.hpp"
|
|
16
|
+
#include "WinBackOfferInputIOS.hpp"
|
|
13
17
|
#include <optional>
|
|
14
18
|
#include <string>
|
|
15
19
|
#include <unordered_map>
|
|
@@ -45,6 +49,12 @@ namespace margelo::nitro::iap {
|
|
|
45
49
|
jni::local_ref<jni::JMap<jni::JString, jni::JString>> withOffer = this->getFieldValue(fieldWithOffer);
|
|
46
50
|
static const auto fieldAdvancedCommerceData = clazz->getField<jni::JString>("advancedCommerceData");
|
|
47
51
|
jni::local_ref<jni::JString> advancedCommerceData = this->getFieldValue(fieldAdvancedCommerceData);
|
|
52
|
+
static const auto fieldIntroductoryOfferEligibility = clazz->getField<jni::JBoolean>("introductoryOfferEligibility");
|
|
53
|
+
jni::local_ref<jni::JBoolean> introductoryOfferEligibility = this->getFieldValue(fieldIntroductoryOfferEligibility);
|
|
54
|
+
static const auto fieldPromotionalOfferJWS = clazz->getField<JPromotionalOfferJwsInputIOS>("promotionalOfferJWS");
|
|
55
|
+
jni::local_ref<JPromotionalOfferJwsInputIOS> promotionalOfferJWS = this->getFieldValue(fieldPromotionalOfferJWS);
|
|
56
|
+
static const auto fieldWinBackOffer = clazz->getField<JWinBackOfferInputIOS>("winBackOffer");
|
|
57
|
+
jni::local_ref<JWinBackOfferInputIOS> winBackOffer = this->getFieldValue(fieldWinBackOffer);
|
|
48
58
|
return NitroRequestPurchaseIos(
|
|
49
59
|
sku->toStdString(),
|
|
50
60
|
andDangerouslyFinishTransactionAutomatically != nullptr ? std::make_optional(static_cast<bool>(andDangerouslyFinishTransactionAutomatically->value())) : std::nullopt,
|
|
@@ -58,7 +68,10 @@ namespace margelo::nitro::iap {
|
|
|
58
68
|
}
|
|
59
69
|
return __map;
|
|
60
70
|
}()) : std::nullopt,
|
|
61
|
-
advancedCommerceData != nullptr ? std::make_optional(advancedCommerceData->toStdString()) : std::nullopt
|
|
71
|
+
advancedCommerceData != nullptr ? std::make_optional(advancedCommerceData->toStdString()) : std::nullopt,
|
|
72
|
+
introductoryOfferEligibility != nullptr ? std::make_optional(static_cast<bool>(introductoryOfferEligibility->value())) : std::nullopt,
|
|
73
|
+
promotionalOfferJWS != nullptr ? std::make_optional(promotionalOfferJWS->toCpp()) : std::nullopt,
|
|
74
|
+
winBackOffer != nullptr ? std::make_optional(winBackOffer->toCpp()) : std::nullopt
|
|
62
75
|
);
|
|
63
76
|
}
|
|
64
77
|
|
|
@@ -68,7 +81,7 @@ namespace margelo::nitro::iap {
|
|
|
68
81
|
*/
|
|
69
82
|
[[maybe_unused]]
|
|
70
83
|
static jni::local_ref<JNitroRequestPurchaseIos::javaobject> fromCpp(const NitroRequestPurchaseIos& value) {
|
|
71
|
-
using JSignature = JNitroRequestPurchaseIos(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JMap<jni::JString, jni::JString>>, jni::alias_ref<jni::JString>);
|
|
84
|
+
using JSignature = JNitroRequestPurchaseIos(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JMap<jni::JString, jni::JString>>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<JPromotionalOfferJwsInputIOS>, jni::alias_ref<JWinBackOfferInputIOS>);
|
|
72
85
|
static const auto clazz = javaClassStatic();
|
|
73
86
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
74
87
|
return create(
|
|
@@ -84,7 +97,10 @@ namespace margelo::nitro::iap {
|
|
|
84
97
|
}
|
|
85
98
|
return __map;
|
|
86
99
|
}() : nullptr,
|
|
87
|
-
value.advancedCommerceData.has_value() ? jni::make_jstring(value.advancedCommerceData.value()) : nullptr
|
|
100
|
+
value.advancedCommerceData.has_value() ? jni::make_jstring(value.advancedCommerceData.value()) : nullptr,
|
|
101
|
+
value.introductoryOfferEligibility.has_value() ? jni::JBoolean::valueOf(value.introductoryOfferEligibility.value()) : nullptr,
|
|
102
|
+
value.promotionalOfferJWS.has_value() ? JPromotionalOfferJwsInputIOS::fromCpp(value.promotionalOfferJWS.value()) : nullptr,
|
|
103
|
+
value.winBackOffer.has_value() ? JWinBackOfferInputIOS::fromCpp(value.winBackOffer.value()) : nullptr
|
|
88
104
|
);
|
|
89
105
|
}
|
|
90
106
|
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JPromotionalOfferJwsInputIOS.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "PromotionalOfferJwsInputIOS.hpp"
|
|
12
|
+
|
|
13
|
+
#include <string>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::iap {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "PromotionalOfferJwsInputIOS" and the the Kotlin data class "PromotionalOfferJwsInputIOS".
|
|
21
|
+
*/
|
|
22
|
+
struct JPromotionalOfferJwsInputIOS final: public jni::JavaClass<JPromotionalOfferJwsInputIOS> {
|
|
23
|
+
public:
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/PromotionalOfferJwsInputIOS;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct PromotionalOfferJwsInputIOS by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
PromotionalOfferJwsInputIOS toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldJws = clazz->getField<jni::JString>("jws");
|
|
35
|
+
jni::local_ref<jni::JString> jws = this->getFieldValue(fieldJws);
|
|
36
|
+
static const auto fieldOfferId = clazz->getField<jni::JString>("offerId");
|
|
37
|
+
jni::local_ref<jni::JString> offerId = this->getFieldValue(fieldOfferId);
|
|
38
|
+
return PromotionalOfferJwsInputIOS(
|
|
39
|
+
jws->toStdString(),
|
|
40
|
+
offerId->toStdString()
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public:
|
|
45
|
+
/**
|
|
46
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
47
|
+
*/
|
|
48
|
+
[[maybe_unused]]
|
|
49
|
+
static jni::local_ref<JPromotionalOfferJwsInputIOS::javaobject> fromCpp(const PromotionalOfferJwsInputIOS& value) {
|
|
50
|
+
using JSignature = JPromotionalOfferJwsInputIOS(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>);
|
|
51
|
+
static const auto clazz = javaClassStatic();
|
|
52
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
53
|
+
return create(
|
|
54
|
+
clazz,
|
|
55
|
+
jni::make_jstring(value.jws),
|
|
56
|
+
jni::make_jstring(value.offerId)
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::iap
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JSubscriptionProductReplacementParamsAndroid.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "SubscriptionProductReplacementParamsAndroid.hpp"
|
|
12
|
+
|
|
13
|
+
#include "JSubscriptionReplacementModeAndroid.hpp"
|
|
14
|
+
#include "SubscriptionReplacementModeAndroid.hpp"
|
|
15
|
+
#include <string>
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::iap {
|
|
18
|
+
|
|
19
|
+
using namespace facebook;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The C++ JNI bridge between the C++ struct "SubscriptionProductReplacementParamsAndroid" and the the Kotlin data class "SubscriptionProductReplacementParamsAndroid".
|
|
23
|
+
*/
|
|
24
|
+
struct JSubscriptionProductReplacementParamsAndroid final: public jni::JavaClass<JSubscriptionProductReplacementParamsAndroid> {
|
|
25
|
+
public:
|
|
26
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/SubscriptionProductReplacementParamsAndroid;";
|
|
27
|
+
|
|
28
|
+
public:
|
|
29
|
+
/**
|
|
30
|
+
* Convert this Java/Kotlin-based struct to the C++ struct SubscriptionProductReplacementParamsAndroid by copying all values to C++.
|
|
31
|
+
*/
|
|
32
|
+
[[maybe_unused]]
|
|
33
|
+
[[nodiscard]]
|
|
34
|
+
SubscriptionProductReplacementParamsAndroid toCpp() const {
|
|
35
|
+
static const auto clazz = javaClassStatic();
|
|
36
|
+
static const auto fieldOldProductId = clazz->getField<jni::JString>("oldProductId");
|
|
37
|
+
jni::local_ref<jni::JString> oldProductId = this->getFieldValue(fieldOldProductId);
|
|
38
|
+
static const auto fieldReplacementMode = clazz->getField<JSubscriptionReplacementModeAndroid>("replacementMode");
|
|
39
|
+
jni::local_ref<JSubscriptionReplacementModeAndroid> replacementMode = this->getFieldValue(fieldReplacementMode);
|
|
40
|
+
return SubscriptionProductReplacementParamsAndroid(
|
|
41
|
+
oldProductId->toStdString(),
|
|
42
|
+
replacementMode->toCpp()
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
/**
|
|
48
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
49
|
+
*/
|
|
50
|
+
[[maybe_unused]]
|
|
51
|
+
static jni::local_ref<JSubscriptionProductReplacementParamsAndroid::javaobject> fromCpp(const SubscriptionProductReplacementParamsAndroid& value) {
|
|
52
|
+
using JSignature = JSubscriptionProductReplacementParamsAndroid(jni::alias_ref<jni::JString>, jni::alias_ref<JSubscriptionReplacementModeAndroid>);
|
|
53
|
+
static const auto clazz = javaClassStatic();
|
|
54
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
55
|
+
return create(
|
|
56
|
+
clazz,
|
|
57
|
+
jni::make_jstring(value.oldProductId),
|
|
58
|
+
JSubscriptionReplacementModeAndroid::fromCpp(value.replacementMode)
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
} // namespace margelo::nitro::iap
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JSubscriptionReplacementModeAndroid.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "SubscriptionReplacementModeAndroid.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::iap {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "SubscriptionReplacementModeAndroid" and the the Kotlin enum "SubscriptionReplacementModeAndroid".
|
|
19
|
+
*/
|
|
20
|
+
struct JSubscriptionReplacementModeAndroid final: public jni::JavaClass<JSubscriptionReplacementModeAndroid> {
|
|
21
|
+
public:
|
|
22
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/SubscriptionReplacementModeAndroid;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum SubscriptionReplacementModeAndroid.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
SubscriptionReplacementModeAndroid 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<SubscriptionReplacementModeAndroid>(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<JSubscriptionReplacementModeAndroid> fromCpp(SubscriptionReplacementModeAndroid value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
static const auto fieldUNKNOWN_REPLACEMENT_MODE = clazz->getStaticField<JSubscriptionReplacementModeAndroid>("UNKNOWN_REPLACEMENT_MODE");
|
|
45
|
+
static const auto fieldWITH_TIME_PRORATION = clazz->getStaticField<JSubscriptionReplacementModeAndroid>("WITH_TIME_PRORATION");
|
|
46
|
+
static const auto fieldCHARGE_PRORATED_PRICE = clazz->getStaticField<JSubscriptionReplacementModeAndroid>("CHARGE_PRORATED_PRICE");
|
|
47
|
+
static const auto fieldCHARGE_FULL_PRICE = clazz->getStaticField<JSubscriptionReplacementModeAndroid>("CHARGE_FULL_PRICE");
|
|
48
|
+
static const auto fieldWITHOUT_PRORATION = clazz->getStaticField<JSubscriptionReplacementModeAndroid>("WITHOUT_PRORATION");
|
|
49
|
+
static const auto fieldDEFERRED = clazz->getStaticField<JSubscriptionReplacementModeAndroid>("DEFERRED");
|
|
50
|
+
static const auto fieldKEEP_EXISTING = clazz->getStaticField<JSubscriptionReplacementModeAndroid>("KEEP_EXISTING");
|
|
51
|
+
|
|
52
|
+
switch (value) {
|
|
53
|
+
case SubscriptionReplacementModeAndroid::UNKNOWN_REPLACEMENT_MODE:
|
|
54
|
+
return clazz->getStaticFieldValue(fieldUNKNOWN_REPLACEMENT_MODE);
|
|
55
|
+
case SubscriptionReplacementModeAndroid::WITH_TIME_PRORATION:
|
|
56
|
+
return clazz->getStaticFieldValue(fieldWITH_TIME_PRORATION);
|
|
57
|
+
case SubscriptionReplacementModeAndroid::CHARGE_PRORATED_PRICE:
|
|
58
|
+
return clazz->getStaticFieldValue(fieldCHARGE_PRORATED_PRICE);
|
|
59
|
+
case SubscriptionReplacementModeAndroid::CHARGE_FULL_PRICE:
|
|
60
|
+
return clazz->getStaticFieldValue(fieldCHARGE_FULL_PRICE);
|
|
61
|
+
case SubscriptionReplacementModeAndroid::WITHOUT_PRORATION:
|
|
62
|
+
return clazz->getStaticFieldValue(fieldWITHOUT_PRORATION);
|
|
63
|
+
case SubscriptionReplacementModeAndroid::DEFERRED:
|
|
64
|
+
return clazz->getStaticFieldValue(fieldDEFERRED);
|
|
65
|
+
case SubscriptionReplacementModeAndroid::KEEP_EXISTING:
|
|
66
|
+
return clazz->getStaticFieldValue(fieldKEEP_EXISTING);
|
|
67
|
+
default:
|
|
68
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
69
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
} // namespace margelo::nitro::iap
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JWinBackOfferInputIOS.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "WinBackOfferInputIOS.hpp"
|
|
12
|
+
|
|
13
|
+
#include <string>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::iap {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "WinBackOfferInputIOS" and the the Kotlin data class "WinBackOfferInputIOS".
|
|
21
|
+
*/
|
|
22
|
+
struct JWinBackOfferInputIOS final: public jni::JavaClass<JWinBackOfferInputIOS> {
|
|
23
|
+
public:
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/WinBackOfferInputIOS;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct WinBackOfferInputIOS by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
WinBackOfferInputIOS toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldOfferId = clazz->getField<jni::JString>("offerId");
|
|
35
|
+
jni::local_ref<jni::JString> offerId = this->getFieldValue(fieldOfferId);
|
|
36
|
+
return WinBackOfferInputIOS(
|
|
37
|
+
offerId->toStdString()
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public:
|
|
42
|
+
/**
|
|
43
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
44
|
+
*/
|
|
45
|
+
[[maybe_unused]]
|
|
46
|
+
static jni::local_ref<JWinBackOfferInputIOS::javaobject> fromCpp(const WinBackOfferInputIOS& value) {
|
|
47
|
+
using JSignature = JWinBackOfferInputIOS(jni::alias_ref<jni::JString>);
|
|
48
|
+
static const auto clazz = javaClassStatic();
|
|
49
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
50
|
+
return create(
|
|
51
|
+
clazz,
|
|
52
|
+
jni::make_jstring(value.offerId)
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
} // namespace margelo::nitro::iap
|
|
@@ -19,7 +19,10 @@ import com.facebook.proguard.annotations.DoNotStrip
|
|
|
19
19
|
data class NitroAvailablePurchasesAndroidOptions(
|
|
20
20
|
@DoNotStrip
|
|
21
21
|
@Keep
|
|
22
|
-
val type: NitroAvailablePurchasesAndroidType
|
|
22
|
+
val type: NitroAvailablePurchasesAndroidType?,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val includeSuspended: Boolean?
|
|
23
26
|
) {
|
|
24
27
|
private companion object {
|
|
25
28
|
/**
|
|
@@ -29,8 +32,8 @@ data class NitroAvailablePurchasesAndroidOptions(
|
|
|
29
32
|
@Keep
|
|
30
33
|
@Suppress("unused")
|
|
31
34
|
@JvmStatic
|
|
32
|
-
private fun fromCpp(type: NitroAvailablePurchasesAndroidType?): NitroAvailablePurchasesAndroidOptions {
|
|
33
|
-
return NitroAvailablePurchasesAndroidOptions(type)
|
|
35
|
+
private fun fromCpp(type: NitroAvailablePurchasesAndroidType?, includeSuspended: Boolean?): NitroAvailablePurchasesAndroidOptions {
|
|
36
|
+
return NitroAvailablePurchasesAndroidOptions(type, includeSuspended)
|
|
34
37
|
}
|
|
35
38
|
}
|
|
36
39
|
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesIosOptions.kt
CHANGED
|
@@ -28,6 +28,9 @@ data class NitroAvailablePurchasesIosOptions(
|
|
|
28
28
|
val alsoPublishToEventListenerIOS: Boolean?,
|
|
29
29
|
@DoNotStrip
|
|
30
30
|
@Keep
|
|
31
|
+
val includeSuspendedAndroid: Boolean?,
|
|
32
|
+
@DoNotStrip
|
|
33
|
+
@Keep
|
|
31
34
|
val onlyIncludeActiveItemsIOS: Boolean?
|
|
32
35
|
) {
|
|
33
36
|
private companion object {
|
|
@@ -38,8 +41,8 @@ data class NitroAvailablePurchasesIosOptions(
|
|
|
38
41
|
@Keep
|
|
39
42
|
@Suppress("unused")
|
|
40
43
|
@JvmStatic
|
|
41
|
-
private fun fromCpp(alsoPublishToEventListener: Boolean?, onlyIncludeActiveItems: Boolean?, alsoPublishToEventListenerIOS: Boolean?, onlyIncludeActiveItemsIOS: Boolean?): NitroAvailablePurchasesIosOptions {
|
|
42
|
-
return NitroAvailablePurchasesIosOptions(alsoPublishToEventListener, onlyIncludeActiveItems, alsoPublishToEventListenerIOS, onlyIncludeActiveItemsIOS)
|
|
44
|
+
private fun fromCpp(alsoPublishToEventListener: Boolean?, onlyIncludeActiveItems: Boolean?, alsoPublishToEventListenerIOS: Boolean?, includeSuspendedAndroid: Boolean?, onlyIncludeActiveItemsIOS: Boolean?): NitroAvailablePurchasesIosOptions {
|
|
45
|
+
return NitroAvailablePurchasesIosOptions(alsoPublishToEventListener, onlyIncludeActiveItems, alsoPublishToEventListenerIOS, includeSuspendedAndroid, onlyIncludeActiveItemsIOS)
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
}
|