react-native-iap 14.4.46 → 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.
- package/NitroIap.podspec +2 -2
- package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +134 -4
- package/ios/HybridRnIap.swift +73 -2
- package/ios/RnIapHelper.swift +8 -0
- package/lib/module/hooks/useIAP.js +9 -1
- package/lib/module/hooks/useIAP.js.map +1 -1
- package/lib/module/index.js +69 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js +5 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/errorMapping.js +32 -6
- package/lib/module/utils/errorMapping.js.map +1 -1
- package/lib/module/utils/type-bridge.js +19 -0
- package/lib/module/utils/type-bridge.js.map +1 -1
- package/lib/typescript/src/hooks/useIAP.d.ts +5 -1
- package/lib/typescript/src/hooks/useIAP.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +34 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/RnIap.nitro.d.ts +86 -26
- package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +145 -55
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/errorMapping.d.ts.map +1 -1
- package/lib/typescript/src/utils/type-bridge.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JFunc_void_NitroPurchase.hpp +2 -0
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +80 -0
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.hpp +2 -0
- package/nitrogen/generated/android/c++/JIapStore.hpp +65 -0
- package/nitrogen/generated/android/c++/JIapkitPurchaseState.hpp +80 -0
- package/nitrogen/generated/android/c++/JNitroPurchase.hpp +7 -1
- package/nitrogen/generated/android/c++/JNitroPurchaseRequest.hpp +11 -3
- package/nitrogen/generated/android/c++/JNitroReceiptValidationResultIOS.hpp +2 -0
- package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithIapkitAppleProps.hpp +57 -0
- package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithIapkitGoogleProps.hpp +57 -0
- package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithIapkitProps.hpp +70 -0
- package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithIapkitResult.hpp +68 -0
- package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithProviderError.hpp +62 -0
- package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithProviderProps.hpp +70 -0
- package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithProviderResult.hpp +94 -0
- package/nitrogen/generated/android/c++/JPurchase.hpp +2 -0
- package/nitrogen/generated/android/c++/JPurchaseAndroid.hpp +7 -1
- package/nitrogen/generated/android/c++/JPurchaseIOS.hpp +7 -1
- package/nitrogen/generated/android/c++/JPurchaseVerificationProvider.hpp +59 -0
- package/nitrogen/generated/android/c++/JRequestPurchaseResult.hpp +2 -0
- package/nitrogen/generated/android/c++/JVariant_NitroReceiptValidationResultIOS_NitroReceiptValidationResultAndroid.hpp +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +8 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/IapStore.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/IapkitPurchaseState.kt +28 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchase.kt +5 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchaseRequest.kt +9 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithIapkitAppleProps.kt +36 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithIapkitGoogleProps.kt +36 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithIapkitProps.kt +42 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithIapkitResult.kt +42 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithProviderError.kt +39 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithProviderProps.kt +39 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithProviderResult.kt +42 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseAndroid.kt +5 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseIOS.kt +5 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseVerificationProvider.kt +21 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.cpp +8 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +156 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +30 -0
- package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +46 -0
- package/nitrogen/generated/ios/swift/Func_void_NitroVerifyPurchaseWithProviderResult.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +2 -0
- package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +45 -0
- package/nitrogen/generated/ios/swift/IapStore.swift +48 -0
- package/nitrogen/generated/ios/swift/IapkitPurchaseState.swift +68 -0
- package/nitrogen/generated/ios/swift/NitroPurchase.swift +13 -2
- package/nitrogen/generated/ios/swift/NitroPurchaseRequest.swift +47 -1
- package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithIapkitAppleProps.swift +35 -0
- package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithIapkitGoogleProps.swift +35 -0
- package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithIapkitProps.swift +100 -0
- package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithIapkitResult.swift +57 -0
- package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithProviderError.swift +65 -0
- package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithProviderProps.swift +58 -0
- package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithProviderResult.swift +100 -0
- package/nitrogen/generated/ios/swift/PurchaseAndroid.swift +13 -2
- package/nitrogen/generated/ios/swift/PurchaseIOS.swift +13 -2
- package/nitrogen/generated/ios/swift/PurchaseVerificationProvider.swift +40 -0
- package/nitrogen/generated/shared/c++/HybridRnIapSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridRnIapSpec.hpp +8 -0
- package/nitrogen/generated/shared/c++/IapStore.hpp +84 -0
- package/nitrogen/generated/shared/c++/IapkitPurchaseState.hpp +104 -0
- package/nitrogen/generated/shared/c++/NitroPurchase.hpp +8 -1
- package/nitrogen/generated/shared/c++/NitroPurchaseRequest.hpp +10 -2
- package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithIapkitAppleProps.hpp +75 -0
- package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithIapkitGoogleProps.hpp +75 -0
- package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithIapkitProps.hpp +89 -0
- package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithIapkitResult.hpp +87 -0
- package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithProviderError.hpp +80 -0
- package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithProviderProps.hpp +84 -0
- package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithProviderResult.hpp +92 -0
- package/nitrogen/generated/shared/c++/PurchaseAndroid.hpp +8 -1
- package/nitrogen/generated/shared/c++/PurchaseIOS.hpp +8 -1
- package/nitrogen/generated/shared/c++/PurchaseVerificationProvider.hpp +76 -0
- package/openiap-versions.json +3 -3
- package/package.json +1 -1
- package/src/hooks/useIAP.ts +32 -0
- package/src/index.ts +77 -5
- package/src/specs/RnIap.nitro.ts +117 -28
- package/src/types.ts +163 -61
- package/src/utils/errorMapping.ts +32 -4
- package/src/utils/type-bridge.ts +22 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNitroVerifyPurchaseWithIapkitGoogleProps.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 "NitroVerifyPurchaseWithIapkitGoogleProps.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 "NitroVerifyPurchaseWithIapkitGoogleProps" and the the Kotlin data class "NitroVerifyPurchaseWithIapkitGoogleProps".
|
|
21
|
+
*/
|
|
22
|
+
struct JNitroVerifyPurchaseWithIapkitGoogleProps final: public jni::JavaClass<JNitroVerifyPurchaseWithIapkitGoogleProps> {
|
|
23
|
+
public:
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/NitroVerifyPurchaseWithIapkitGoogleProps;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct NitroVerifyPurchaseWithIapkitGoogleProps by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
NitroVerifyPurchaseWithIapkitGoogleProps toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldPurchaseToken = clazz->getField<jni::JString>("purchaseToken");
|
|
35
|
+
jni::local_ref<jni::JString> purchaseToken = this->getFieldValue(fieldPurchaseToken);
|
|
36
|
+
return NitroVerifyPurchaseWithIapkitGoogleProps(
|
|
37
|
+
purchaseToken->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<JNitroVerifyPurchaseWithIapkitGoogleProps::javaobject> fromCpp(const NitroVerifyPurchaseWithIapkitGoogleProps& value) {
|
|
47
|
+
using JSignature = JNitroVerifyPurchaseWithIapkitGoogleProps(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.purchaseToken)
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
} // namespace margelo::nitro::iap
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNitroVerifyPurchaseWithIapkitProps.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 "NitroVerifyPurchaseWithIapkitProps.hpp"
|
|
12
|
+
|
|
13
|
+
#include "JNitroVerifyPurchaseWithIapkitAppleProps.hpp"
|
|
14
|
+
#include "JNitroVerifyPurchaseWithIapkitGoogleProps.hpp"
|
|
15
|
+
#include "NitroVerifyPurchaseWithIapkitAppleProps.hpp"
|
|
16
|
+
#include "NitroVerifyPurchaseWithIapkitGoogleProps.hpp"
|
|
17
|
+
#include <optional>
|
|
18
|
+
#include <string>
|
|
19
|
+
|
|
20
|
+
namespace margelo::nitro::iap {
|
|
21
|
+
|
|
22
|
+
using namespace facebook;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The C++ JNI bridge between the C++ struct "NitroVerifyPurchaseWithIapkitProps" and the the Kotlin data class "NitroVerifyPurchaseWithIapkitProps".
|
|
26
|
+
*/
|
|
27
|
+
struct JNitroVerifyPurchaseWithIapkitProps final: public jni::JavaClass<JNitroVerifyPurchaseWithIapkitProps> {
|
|
28
|
+
public:
|
|
29
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/NitroVerifyPurchaseWithIapkitProps;";
|
|
30
|
+
|
|
31
|
+
public:
|
|
32
|
+
/**
|
|
33
|
+
* Convert this Java/Kotlin-based struct to the C++ struct NitroVerifyPurchaseWithIapkitProps by copying all values to C++.
|
|
34
|
+
*/
|
|
35
|
+
[[maybe_unused]]
|
|
36
|
+
[[nodiscard]]
|
|
37
|
+
NitroVerifyPurchaseWithIapkitProps toCpp() const {
|
|
38
|
+
static const auto clazz = javaClassStatic();
|
|
39
|
+
static const auto fieldApiKey = clazz->getField<jni::JString>("apiKey");
|
|
40
|
+
jni::local_ref<jni::JString> apiKey = this->getFieldValue(fieldApiKey);
|
|
41
|
+
static const auto fieldApple = clazz->getField<JNitroVerifyPurchaseWithIapkitAppleProps>("apple");
|
|
42
|
+
jni::local_ref<JNitroVerifyPurchaseWithIapkitAppleProps> apple = this->getFieldValue(fieldApple);
|
|
43
|
+
static const auto fieldGoogle = clazz->getField<JNitroVerifyPurchaseWithIapkitGoogleProps>("google");
|
|
44
|
+
jni::local_ref<JNitroVerifyPurchaseWithIapkitGoogleProps> google = this->getFieldValue(fieldGoogle);
|
|
45
|
+
return NitroVerifyPurchaseWithIapkitProps(
|
|
46
|
+
apiKey != nullptr ? std::make_optional(apiKey->toStdString()) : std::nullopt,
|
|
47
|
+
apple != nullptr ? std::make_optional(apple->toCpp()) : std::nullopt,
|
|
48
|
+
google != nullptr ? std::make_optional(google->toCpp()) : std::nullopt
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public:
|
|
53
|
+
/**
|
|
54
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
55
|
+
*/
|
|
56
|
+
[[maybe_unused]]
|
|
57
|
+
static jni::local_ref<JNitroVerifyPurchaseWithIapkitProps::javaobject> fromCpp(const NitroVerifyPurchaseWithIapkitProps& value) {
|
|
58
|
+
using JSignature = JNitroVerifyPurchaseWithIapkitProps(jni::alias_ref<jni::JString>, jni::alias_ref<JNitroVerifyPurchaseWithIapkitAppleProps>, jni::alias_ref<JNitroVerifyPurchaseWithIapkitGoogleProps>);
|
|
59
|
+
static const auto clazz = javaClassStatic();
|
|
60
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
61
|
+
return create(
|
|
62
|
+
clazz,
|
|
63
|
+
value.apiKey.has_value() ? jni::make_jstring(value.apiKey.value()) : nullptr,
|
|
64
|
+
value.apple.has_value() ? JNitroVerifyPurchaseWithIapkitAppleProps::fromCpp(value.apple.value()) : nullptr,
|
|
65
|
+
value.google.has_value() ? JNitroVerifyPurchaseWithIapkitGoogleProps::fromCpp(value.google.value()) : nullptr
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
} // namespace margelo::nitro::iap
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNitroVerifyPurchaseWithIapkitResult.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 "NitroVerifyPurchaseWithIapkitResult.hpp"
|
|
12
|
+
|
|
13
|
+
#include "IapStore.hpp"
|
|
14
|
+
#include "IapkitPurchaseState.hpp"
|
|
15
|
+
#include "JIapStore.hpp"
|
|
16
|
+
#include "JIapkitPurchaseState.hpp"
|
|
17
|
+
|
|
18
|
+
namespace margelo::nitro::iap {
|
|
19
|
+
|
|
20
|
+
using namespace facebook;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The C++ JNI bridge between the C++ struct "NitroVerifyPurchaseWithIapkitResult" and the the Kotlin data class "NitroVerifyPurchaseWithIapkitResult".
|
|
24
|
+
*/
|
|
25
|
+
struct JNitroVerifyPurchaseWithIapkitResult final: public jni::JavaClass<JNitroVerifyPurchaseWithIapkitResult> {
|
|
26
|
+
public:
|
|
27
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/NitroVerifyPurchaseWithIapkitResult;";
|
|
28
|
+
|
|
29
|
+
public:
|
|
30
|
+
/**
|
|
31
|
+
* Convert this Java/Kotlin-based struct to the C++ struct NitroVerifyPurchaseWithIapkitResult by copying all values to C++.
|
|
32
|
+
*/
|
|
33
|
+
[[maybe_unused]]
|
|
34
|
+
[[nodiscard]]
|
|
35
|
+
NitroVerifyPurchaseWithIapkitResult toCpp() const {
|
|
36
|
+
static const auto clazz = javaClassStatic();
|
|
37
|
+
static const auto fieldIsValid = clazz->getField<jboolean>("isValid");
|
|
38
|
+
jboolean isValid = this->getFieldValue(fieldIsValid);
|
|
39
|
+
static const auto fieldState = clazz->getField<JIapkitPurchaseState>("state");
|
|
40
|
+
jni::local_ref<JIapkitPurchaseState> state = this->getFieldValue(fieldState);
|
|
41
|
+
static const auto fieldStore = clazz->getField<JIapStore>("store");
|
|
42
|
+
jni::local_ref<JIapStore> store = this->getFieldValue(fieldStore);
|
|
43
|
+
return NitroVerifyPurchaseWithIapkitResult(
|
|
44
|
+
static_cast<bool>(isValid),
|
|
45
|
+
state->toCpp(),
|
|
46
|
+
store->toCpp()
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
/**
|
|
52
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
53
|
+
*/
|
|
54
|
+
[[maybe_unused]]
|
|
55
|
+
static jni::local_ref<JNitroVerifyPurchaseWithIapkitResult::javaobject> fromCpp(const NitroVerifyPurchaseWithIapkitResult& value) {
|
|
56
|
+
using JSignature = JNitroVerifyPurchaseWithIapkitResult(jboolean, jni::alias_ref<JIapkitPurchaseState>, jni::alias_ref<JIapStore>);
|
|
57
|
+
static const auto clazz = javaClassStatic();
|
|
58
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
59
|
+
return create(
|
|
60
|
+
clazz,
|
|
61
|
+
value.isValid,
|
|
62
|
+
JIapkitPurchaseState::fromCpp(value.state),
|
|
63
|
+
JIapStore::fromCpp(value.store)
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
} // namespace margelo::nitro::iap
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNitroVerifyPurchaseWithProviderError.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 "NitroVerifyPurchaseWithProviderError.hpp"
|
|
12
|
+
|
|
13
|
+
#include <optional>
|
|
14
|
+
#include <string>
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::iap {
|
|
17
|
+
|
|
18
|
+
using namespace facebook;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "NitroVerifyPurchaseWithProviderError" and the the Kotlin data class "NitroVerifyPurchaseWithProviderError".
|
|
22
|
+
*/
|
|
23
|
+
struct JNitroVerifyPurchaseWithProviderError final: public jni::JavaClass<JNitroVerifyPurchaseWithProviderError> {
|
|
24
|
+
public:
|
|
25
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/NitroVerifyPurchaseWithProviderError;";
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
/**
|
|
29
|
+
* Convert this Java/Kotlin-based struct to the C++ struct NitroVerifyPurchaseWithProviderError by copying all values to C++.
|
|
30
|
+
*/
|
|
31
|
+
[[maybe_unused]]
|
|
32
|
+
[[nodiscard]]
|
|
33
|
+
NitroVerifyPurchaseWithProviderError toCpp() const {
|
|
34
|
+
static const auto clazz = javaClassStatic();
|
|
35
|
+
static const auto fieldCode = clazz->getField<jni::JString>("code");
|
|
36
|
+
jni::local_ref<jni::JString> code = this->getFieldValue(fieldCode);
|
|
37
|
+
static const auto fieldMessage = clazz->getField<jni::JString>("message");
|
|
38
|
+
jni::local_ref<jni::JString> message = this->getFieldValue(fieldMessage);
|
|
39
|
+
return NitroVerifyPurchaseWithProviderError(
|
|
40
|
+
code != nullptr ? std::make_optional(code->toStdString()) : std::nullopt,
|
|
41
|
+
message->toStdString()
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
/**
|
|
47
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
48
|
+
*/
|
|
49
|
+
[[maybe_unused]]
|
|
50
|
+
static jni::local_ref<JNitroVerifyPurchaseWithProviderError::javaobject> fromCpp(const NitroVerifyPurchaseWithProviderError& value) {
|
|
51
|
+
using JSignature = JNitroVerifyPurchaseWithProviderError(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>);
|
|
52
|
+
static const auto clazz = javaClassStatic();
|
|
53
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
54
|
+
return create(
|
|
55
|
+
clazz,
|
|
56
|
+
value.code.has_value() ? jni::make_jstring(value.code.value()) : nullptr,
|
|
57
|
+
jni::make_jstring(value.message)
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
} // namespace margelo::nitro::iap
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNitroVerifyPurchaseWithProviderProps.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 "NitroVerifyPurchaseWithProviderProps.hpp"
|
|
12
|
+
|
|
13
|
+
#include "JNitroVerifyPurchaseWithIapkitAppleProps.hpp"
|
|
14
|
+
#include "JNitroVerifyPurchaseWithIapkitGoogleProps.hpp"
|
|
15
|
+
#include "JNitroVerifyPurchaseWithIapkitProps.hpp"
|
|
16
|
+
#include "JPurchaseVerificationProvider.hpp"
|
|
17
|
+
#include "NitroVerifyPurchaseWithIapkitAppleProps.hpp"
|
|
18
|
+
#include "NitroVerifyPurchaseWithIapkitGoogleProps.hpp"
|
|
19
|
+
#include "NitroVerifyPurchaseWithIapkitProps.hpp"
|
|
20
|
+
#include "PurchaseVerificationProvider.hpp"
|
|
21
|
+
#include <optional>
|
|
22
|
+
#include <string>
|
|
23
|
+
|
|
24
|
+
namespace margelo::nitro::iap {
|
|
25
|
+
|
|
26
|
+
using namespace facebook;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The C++ JNI bridge between the C++ struct "NitroVerifyPurchaseWithProviderProps" and the the Kotlin data class "NitroVerifyPurchaseWithProviderProps".
|
|
30
|
+
*/
|
|
31
|
+
struct JNitroVerifyPurchaseWithProviderProps final: public jni::JavaClass<JNitroVerifyPurchaseWithProviderProps> {
|
|
32
|
+
public:
|
|
33
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/NitroVerifyPurchaseWithProviderProps;";
|
|
34
|
+
|
|
35
|
+
public:
|
|
36
|
+
/**
|
|
37
|
+
* Convert this Java/Kotlin-based struct to the C++ struct NitroVerifyPurchaseWithProviderProps by copying all values to C++.
|
|
38
|
+
*/
|
|
39
|
+
[[maybe_unused]]
|
|
40
|
+
[[nodiscard]]
|
|
41
|
+
NitroVerifyPurchaseWithProviderProps toCpp() const {
|
|
42
|
+
static const auto clazz = javaClassStatic();
|
|
43
|
+
static const auto fieldIapkit = clazz->getField<JNitroVerifyPurchaseWithIapkitProps>("iapkit");
|
|
44
|
+
jni::local_ref<JNitroVerifyPurchaseWithIapkitProps> iapkit = this->getFieldValue(fieldIapkit);
|
|
45
|
+
static const auto fieldProvider = clazz->getField<JPurchaseVerificationProvider>("provider");
|
|
46
|
+
jni::local_ref<JPurchaseVerificationProvider> provider = this->getFieldValue(fieldProvider);
|
|
47
|
+
return NitroVerifyPurchaseWithProviderProps(
|
|
48
|
+
iapkit != nullptr ? std::make_optional(iapkit->toCpp()) : std::nullopt,
|
|
49
|
+
provider->toCpp()
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public:
|
|
54
|
+
/**
|
|
55
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
56
|
+
*/
|
|
57
|
+
[[maybe_unused]]
|
|
58
|
+
static jni::local_ref<JNitroVerifyPurchaseWithProviderProps::javaobject> fromCpp(const NitroVerifyPurchaseWithProviderProps& value) {
|
|
59
|
+
using JSignature = JNitroVerifyPurchaseWithProviderProps(jni::alias_ref<JNitroVerifyPurchaseWithIapkitProps>, jni::alias_ref<JPurchaseVerificationProvider>);
|
|
60
|
+
static const auto clazz = javaClassStatic();
|
|
61
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
62
|
+
return create(
|
|
63
|
+
clazz,
|
|
64
|
+
value.iapkit.has_value() ? JNitroVerifyPurchaseWithIapkitProps::fromCpp(value.iapkit.value()) : nullptr,
|
|
65
|
+
JPurchaseVerificationProvider::fromCpp(value.provider)
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
} // namespace margelo::nitro::iap
|
|
@@ -0,0 +1,94 @@
|
|
|
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 "IapStore.hpp"
|
|
14
|
+
#include "IapkitPurchaseState.hpp"
|
|
15
|
+
#include "JIapStore.hpp"
|
|
16
|
+
#include "JIapkitPurchaseState.hpp"
|
|
17
|
+
#include "JNitroVerifyPurchaseWithIapkitResult.hpp"
|
|
18
|
+
#include "JNitroVerifyPurchaseWithProviderError.hpp"
|
|
19
|
+
#include "JPurchaseVerificationProvider.hpp"
|
|
20
|
+
#include "NitroVerifyPurchaseWithIapkitResult.hpp"
|
|
21
|
+
#include "NitroVerifyPurchaseWithProviderError.hpp"
|
|
22
|
+
#include "PurchaseVerificationProvider.hpp"
|
|
23
|
+
#include <optional>
|
|
24
|
+
#include <string>
|
|
25
|
+
#include <vector>
|
|
26
|
+
|
|
27
|
+
namespace margelo::nitro::iap {
|
|
28
|
+
|
|
29
|
+
using namespace facebook;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The C++ JNI bridge between the C++ struct "NitroVerifyPurchaseWithProviderResult" and the the Kotlin data class "NitroVerifyPurchaseWithProviderResult".
|
|
33
|
+
*/
|
|
34
|
+
struct JNitroVerifyPurchaseWithProviderResult final: public jni::JavaClass<JNitroVerifyPurchaseWithProviderResult> {
|
|
35
|
+
public:
|
|
36
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/NitroVerifyPurchaseWithProviderResult;";
|
|
37
|
+
|
|
38
|
+
public:
|
|
39
|
+
/**
|
|
40
|
+
* Convert this Java/Kotlin-based struct to the C++ struct NitroVerifyPurchaseWithProviderResult by copying all values to C++.
|
|
41
|
+
*/
|
|
42
|
+
[[maybe_unused]]
|
|
43
|
+
[[nodiscard]]
|
|
44
|
+
NitroVerifyPurchaseWithProviderResult toCpp() const {
|
|
45
|
+
static const auto clazz = javaClassStatic();
|
|
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);
|
|
50
|
+
static const auto fieldProvider = clazz->getField<JPurchaseVerificationProvider>("provider");
|
|
51
|
+
jni::local_ref<JPurchaseVerificationProvider> provider = this->getFieldValue(fieldProvider);
|
|
52
|
+
return NitroVerifyPurchaseWithProviderResult(
|
|
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;
|
|
57
|
+
__vector.reserve(__size);
|
|
58
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
59
|
+
auto __element = errors->getElement(__i);
|
|
60
|
+
__vector.push_back(__element->toCpp());
|
|
61
|
+
}
|
|
62
|
+
return __vector;
|
|
63
|
+
}()) : std::nullopt,
|
|
64
|
+
provider->toCpp()
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public:
|
|
69
|
+
/**
|
|
70
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
71
|
+
*/
|
|
72
|
+
[[maybe_unused]]
|
|
73
|
+
static jni::local_ref<JNitroVerifyPurchaseWithProviderResult::javaobject> fromCpp(const NitroVerifyPurchaseWithProviderResult& value) {
|
|
74
|
+
using JSignature = JNitroVerifyPurchaseWithProviderResult(jni::alias_ref<JNitroVerifyPurchaseWithIapkitResult>, jni::alias_ref<jni::JArrayClass<JNitroVerifyPurchaseWithProviderError>>, jni::alias_ref<JPurchaseVerificationProvider>);
|
|
75
|
+
static const auto clazz = javaClassStatic();
|
|
76
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
77
|
+
return create(
|
|
78
|
+
clazz,
|
|
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);
|
|
83
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
84
|
+
const auto& __element = value.errors.value()[__i];
|
|
85
|
+
__array->setElement(__i, *JNitroVerifyPurchaseWithProviderError::fromCpp(__element));
|
|
86
|
+
}
|
|
87
|
+
return __array;
|
|
88
|
+
}() : nullptr,
|
|
89
|
+
JPurchaseVerificationProvider::fromCpp(value.provider)
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
} // namespace margelo::nitro::iap
|
|
@@ -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,
|
|
@@ -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,23 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// IapStore.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 "IapStore".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class IapStore(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
UNKNOWN(0),
|
|
20
|
+
APPLE(1),
|
|
21
|
+
GOOGLE(2),
|
|
22
|
+
HORIZON(3);
|
|
23
|
+
}
|