react-native-iap 14.6.0-rc.1 → 14.6.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +72 -36
- package/ios/HybridRnIap.swift +8 -2
- package/lib/module/hooks/useIAP.js +1 -6
- package/lib/module/hooks/useIAP.js.map +1 -1
- package/lib/module/index.js +62 -10
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js +58 -0
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/plugin/src/withIAP.d.ts +6 -0
- package/lib/typescript/plugin/src/withIAP.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useIAP.d.ts +5 -7
- package/lib/typescript/src/hooks/useIAP.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +20 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/RnIap.nitro.d.ts +19 -8
- package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +94 -9
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +12 -4
- package/nitrogen/generated/android/c++/JNitroReceiptValidationAppleOptions.hpp +57 -0
- package/nitrogen/generated/android/c++/{JNitroReceiptValidationAndroidOptions.hpp → JNitroReceiptValidationGoogleOptions.hpp} +18 -14
- package/nitrogen/generated/android/c++/JNitroReceiptValidationHorizonOptions.hpp +65 -0
- package/nitrogen/generated/android/c++/JNitroReceiptValidationParams.hpp +19 -11
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationAppleOptions.kt +36 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/{NitroReceiptValidationAndroidOptions.kt → NitroReceiptValidationGoogleOptions.kt} +9 -6
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationHorizonOptions.kt +42 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationParams.kt +7 -4
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +46 -10
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +9 -3
- package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +9 -3
- package/nitrogen/generated/ios/swift/NitroReceiptValidationAppleOptions.swift +35 -0
- package/nitrogen/generated/ios/swift/{NitroReceiptValidationAndroidOptions.swift → NitroReceiptValidationGoogleOptions.swift} +21 -10
- package/nitrogen/generated/ios/swift/NitroReceiptValidationHorizonOptions.swift +57 -0
- package/nitrogen/generated/ios/swift/NitroReceiptValidationParams.swift +46 -11
- package/nitrogen/generated/shared/c++/NitroReceiptValidationAppleOptions.hpp +75 -0
- package/nitrogen/generated/shared/c++/{NitroReceiptValidationAndroidOptions.hpp → NitroReceiptValidationGoogleOptions.hpp} +18 -14
- package/nitrogen/generated/shared/c++/NitroReceiptValidationHorizonOptions.hpp +83 -0
- package/nitrogen/generated/shared/c++/NitroReceiptValidationParams.hpp +22 -13
- package/openiap-versions.json +3 -3
- package/package.json +1 -1
- package/plugin/build/withIAP.d.ts +6 -0
- package/plugin/build/withIAP.js +46 -2
- package/plugin/src/withIAP.ts +67 -2
- package/src/hooks/useIAP.ts +8 -23
- package/src/index.ts +79 -14
- package/src/specs/RnIap.nitro.ts +24 -10
- package/src/types.ts +97 -9
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNitroReceiptValidationAppleOptions.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 "NitroReceiptValidationAppleOptions.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 "NitroReceiptValidationAppleOptions" and the the Kotlin data class "NitroReceiptValidationAppleOptions".
|
|
21
|
+
*/
|
|
22
|
+
struct JNitroReceiptValidationAppleOptions final: public jni::JavaClass<JNitroReceiptValidationAppleOptions> {
|
|
23
|
+
public:
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/NitroReceiptValidationAppleOptions;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct NitroReceiptValidationAppleOptions by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
NitroReceiptValidationAppleOptions toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldSku = clazz->getField<jni::JString>("sku");
|
|
35
|
+
jni::local_ref<jni::JString> sku = this->getFieldValue(fieldSku);
|
|
36
|
+
return NitroReceiptValidationAppleOptions(
|
|
37
|
+
sku->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<JNitroReceiptValidationAppleOptions::javaobject> fromCpp(const NitroReceiptValidationAppleOptions& value) {
|
|
47
|
+
using JSignature = JNitroReceiptValidationAppleOptions(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.sku)
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
} // namespace margelo::nitro::iap
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// JNitroReceiptValidationGoogleOptions.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
#include <fbjni/fbjni.h>
|
|
11
|
-
#include "
|
|
11
|
+
#include "NitroReceiptValidationGoogleOptions.hpp"
|
|
12
12
|
|
|
13
13
|
#include <optional>
|
|
14
14
|
#include <string>
|
|
@@ -18,19 +18,19 @@ namespace margelo::nitro::iap {
|
|
|
18
18
|
using namespace facebook;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* The C++ JNI bridge between the C++ struct "
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "NitroReceiptValidationGoogleOptions" and the the Kotlin data class "NitroReceiptValidationGoogleOptions".
|
|
22
22
|
*/
|
|
23
|
-
struct
|
|
23
|
+
struct JNitroReceiptValidationGoogleOptions final: public jni::JavaClass<JNitroReceiptValidationGoogleOptions> {
|
|
24
24
|
public:
|
|
25
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/
|
|
25
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/NitroReceiptValidationGoogleOptions;";
|
|
26
26
|
|
|
27
27
|
public:
|
|
28
28
|
/**
|
|
29
|
-
* Convert this Java/Kotlin-based struct to the C++ struct
|
|
29
|
+
* Convert this Java/Kotlin-based struct to the C++ struct NitroReceiptValidationGoogleOptions by copying all values to C++.
|
|
30
30
|
*/
|
|
31
31
|
[[maybe_unused]]
|
|
32
32
|
[[nodiscard]]
|
|
33
|
-
|
|
33
|
+
NitroReceiptValidationGoogleOptions toCpp() const {
|
|
34
34
|
static const auto clazz = javaClassStatic();
|
|
35
35
|
static const auto fieldAccessToken = clazz->getField<jni::JString>("accessToken");
|
|
36
36
|
jni::local_ref<jni::JString> accessToken = this->getFieldValue(fieldAccessToken);
|
|
@@ -38,13 +38,16 @@ namespace margelo::nitro::iap {
|
|
|
38
38
|
jni::local_ref<jni::JBoolean> isSub = this->getFieldValue(fieldIsSub);
|
|
39
39
|
static const auto fieldPackageName = clazz->getField<jni::JString>("packageName");
|
|
40
40
|
jni::local_ref<jni::JString> packageName = this->getFieldValue(fieldPackageName);
|
|
41
|
-
static const auto
|
|
42
|
-
jni::local_ref<jni::JString>
|
|
43
|
-
|
|
41
|
+
static const auto fieldPurchaseToken = clazz->getField<jni::JString>("purchaseToken");
|
|
42
|
+
jni::local_ref<jni::JString> purchaseToken = this->getFieldValue(fieldPurchaseToken);
|
|
43
|
+
static const auto fieldSku = clazz->getField<jni::JString>("sku");
|
|
44
|
+
jni::local_ref<jni::JString> sku = this->getFieldValue(fieldSku);
|
|
45
|
+
return NitroReceiptValidationGoogleOptions(
|
|
44
46
|
accessToken->toStdString(),
|
|
45
47
|
isSub != nullptr ? std::make_optional(static_cast<bool>(isSub->value())) : std::nullopt,
|
|
46
48
|
packageName->toStdString(),
|
|
47
|
-
|
|
49
|
+
purchaseToken->toStdString(),
|
|
50
|
+
sku->toStdString()
|
|
48
51
|
);
|
|
49
52
|
}
|
|
50
53
|
|
|
@@ -53,8 +56,8 @@ namespace margelo::nitro::iap {
|
|
|
53
56
|
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
54
57
|
*/
|
|
55
58
|
[[maybe_unused]]
|
|
56
|
-
static jni::local_ref<
|
|
57
|
-
using JSignature =
|
|
59
|
+
static jni::local_ref<JNitroReceiptValidationGoogleOptions::javaobject> fromCpp(const NitroReceiptValidationGoogleOptions& value) {
|
|
60
|
+
using JSignature = JNitroReceiptValidationGoogleOptions(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>);
|
|
58
61
|
static const auto clazz = javaClassStatic();
|
|
59
62
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
60
63
|
return create(
|
|
@@ -62,7 +65,8 @@ namespace margelo::nitro::iap {
|
|
|
62
65
|
jni::make_jstring(value.accessToken),
|
|
63
66
|
value.isSub.has_value() ? jni::JBoolean::valueOf(value.isSub.value()) : nullptr,
|
|
64
67
|
jni::make_jstring(value.packageName),
|
|
65
|
-
jni::make_jstring(value.
|
|
68
|
+
jni::make_jstring(value.purchaseToken),
|
|
69
|
+
jni::make_jstring(value.sku)
|
|
66
70
|
);
|
|
67
71
|
}
|
|
68
72
|
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNitroReceiptValidationHorizonOptions.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 "NitroReceiptValidationHorizonOptions.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 "NitroReceiptValidationHorizonOptions" and the the Kotlin data class "NitroReceiptValidationHorizonOptions".
|
|
21
|
+
*/
|
|
22
|
+
struct JNitroReceiptValidationHorizonOptions final: public jni::JavaClass<JNitroReceiptValidationHorizonOptions> {
|
|
23
|
+
public:
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/NitroReceiptValidationHorizonOptions;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct NitroReceiptValidationHorizonOptions by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
NitroReceiptValidationHorizonOptions toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldAccessToken = clazz->getField<jni::JString>("accessToken");
|
|
35
|
+
jni::local_ref<jni::JString> accessToken = this->getFieldValue(fieldAccessToken);
|
|
36
|
+
static const auto fieldSku = clazz->getField<jni::JString>("sku");
|
|
37
|
+
jni::local_ref<jni::JString> sku = this->getFieldValue(fieldSku);
|
|
38
|
+
static const auto fieldUserId = clazz->getField<jni::JString>("userId");
|
|
39
|
+
jni::local_ref<jni::JString> userId = this->getFieldValue(fieldUserId);
|
|
40
|
+
return NitroReceiptValidationHorizonOptions(
|
|
41
|
+
accessToken->toStdString(),
|
|
42
|
+
sku->toStdString(),
|
|
43
|
+
userId->toStdString()
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public:
|
|
48
|
+
/**
|
|
49
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
50
|
+
*/
|
|
51
|
+
[[maybe_unused]]
|
|
52
|
+
static jni::local_ref<JNitroReceiptValidationHorizonOptions::javaobject> fromCpp(const NitroReceiptValidationHorizonOptions& value) {
|
|
53
|
+
using JSignature = JNitroReceiptValidationHorizonOptions(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>);
|
|
54
|
+
static const auto clazz = javaClassStatic();
|
|
55
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
56
|
+
return create(
|
|
57
|
+
clazz,
|
|
58
|
+
jni::make_jstring(value.accessToken),
|
|
59
|
+
jni::make_jstring(value.sku),
|
|
60
|
+
jni::make_jstring(value.userId)
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
} // namespace margelo::nitro::iap
|
|
@@ -10,8 +10,12 @@
|
|
|
10
10
|
#include <fbjni/fbjni.h>
|
|
11
11
|
#include "NitroReceiptValidationParams.hpp"
|
|
12
12
|
|
|
13
|
-
#include "
|
|
14
|
-
#include "
|
|
13
|
+
#include "JNitroReceiptValidationAppleOptions.hpp"
|
|
14
|
+
#include "JNitroReceiptValidationGoogleOptions.hpp"
|
|
15
|
+
#include "JNitroReceiptValidationHorizonOptions.hpp"
|
|
16
|
+
#include "NitroReceiptValidationAppleOptions.hpp"
|
|
17
|
+
#include "NitroReceiptValidationGoogleOptions.hpp"
|
|
18
|
+
#include "NitroReceiptValidationHorizonOptions.hpp"
|
|
15
19
|
#include <optional>
|
|
16
20
|
#include <string>
|
|
17
21
|
|
|
@@ -34,13 +38,16 @@ namespace margelo::nitro::iap {
|
|
|
34
38
|
[[nodiscard]]
|
|
35
39
|
NitroReceiptValidationParams toCpp() const {
|
|
36
40
|
static const auto clazz = javaClassStatic();
|
|
37
|
-
static const auto
|
|
38
|
-
jni::local_ref<
|
|
39
|
-
static const auto
|
|
40
|
-
jni::local_ref<
|
|
41
|
+
static const auto fieldApple = clazz->getField<JNitroReceiptValidationAppleOptions>("apple");
|
|
42
|
+
jni::local_ref<JNitroReceiptValidationAppleOptions> apple = this->getFieldValue(fieldApple);
|
|
43
|
+
static const auto fieldGoogle = clazz->getField<JNitroReceiptValidationGoogleOptions>("google");
|
|
44
|
+
jni::local_ref<JNitroReceiptValidationGoogleOptions> google = this->getFieldValue(fieldGoogle);
|
|
45
|
+
static const auto fieldHorizon = clazz->getField<JNitroReceiptValidationHorizonOptions>("horizon");
|
|
46
|
+
jni::local_ref<JNitroReceiptValidationHorizonOptions> horizon = this->getFieldValue(fieldHorizon);
|
|
41
47
|
return NitroReceiptValidationParams(
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
apple != nullptr ? std::make_optional(apple->toCpp()) : std::nullopt,
|
|
49
|
+
google != nullptr ? std::make_optional(google->toCpp()) : std::nullopt,
|
|
50
|
+
horizon != nullptr ? std::make_optional(horizon->toCpp()) : std::nullopt
|
|
44
51
|
);
|
|
45
52
|
}
|
|
46
53
|
|
|
@@ -50,13 +57,14 @@ namespace margelo::nitro::iap {
|
|
|
50
57
|
*/
|
|
51
58
|
[[maybe_unused]]
|
|
52
59
|
static jni::local_ref<JNitroReceiptValidationParams::javaobject> fromCpp(const NitroReceiptValidationParams& value) {
|
|
53
|
-
using JSignature = JNitroReceiptValidationParams(jni::alias_ref<jni::
|
|
60
|
+
using JSignature = JNitroReceiptValidationParams(jni::alias_ref<JNitroReceiptValidationAppleOptions>, jni::alias_ref<JNitroReceiptValidationGoogleOptions>, jni::alias_ref<JNitroReceiptValidationHorizonOptions>);
|
|
54
61
|
static const auto clazz = javaClassStatic();
|
|
55
62
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
56
63
|
return create(
|
|
57
64
|
clazz,
|
|
58
|
-
|
|
59
|
-
value.
|
|
65
|
+
value.apple.has_value() ? JNitroReceiptValidationAppleOptions::fromCpp(value.apple.value()) : nullptr,
|
|
66
|
+
value.google.has_value() ? JNitroReceiptValidationGoogleOptions::fromCpp(value.google.value()) : nullptr,
|
|
67
|
+
value.horizon.has_value() ? JNitroReceiptValidationHorizonOptions::fromCpp(value.horizon.value()) : nullptr
|
|
60
68
|
);
|
|
61
69
|
}
|
|
62
70
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroReceiptValidationAppleOptions.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 "NitroReceiptValidationAppleOptions".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class NitroReceiptValidationAppleOptions(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val sku: String
|
|
23
|
+
) {
|
|
24
|
+
private companion object {
|
|
25
|
+
/**
|
|
26
|
+
* Constructor called from C++
|
|
27
|
+
*/
|
|
28
|
+
@DoNotStrip
|
|
29
|
+
@Keep
|
|
30
|
+
@Suppress("unused")
|
|
31
|
+
@JvmStatic
|
|
32
|
+
private fun fromCpp(sku: String): NitroReceiptValidationAppleOptions {
|
|
33
|
+
return NitroReceiptValidationAppleOptions(sku)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// NitroReceiptValidationGoogleOptions.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
|
|
@@ -12,11 +12,11 @@ import com.facebook.proguard.annotations.DoNotStrip
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* Represents the JavaScript object/struct "
|
|
15
|
+
* Represents the JavaScript object/struct "NitroReceiptValidationGoogleOptions".
|
|
16
16
|
*/
|
|
17
17
|
@DoNotStrip
|
|
18
18
|
@Keep
|
|
19
|
-
data class
|
|
19
|
+
data class NitroReceiptValidationGoogleOptions(
|
|
20
20
|
@DoNotStrip
|
|
21
21
|
@Keep
|
|
22
22
|
val accessToken: String,
|
|
@@ -28,7 +28,10 @@ data class NitroReceiptValidationAndroidOptions(
|
|
|
28
28
|
val packageName: String,
|
|
29
29
|
@DoNotStrip
|
|
30
30
|
@Keep
|
|
31
|
-
val
|
|
31
|
+
val purchaseToken: String,
|
|
32
|
+
@DoNotStrip
|
|
33
|
+
@Keep
|
|
34
|
+
val sku: String
|
|
32
35
|
) {
|
|
33
36
|
private companion object {
|
|
34
37
|
/**
|
|
@@ -38,8 +41,8 @@ data class NitroReceiptValidationAndroidOptions(
|
|
|
38
41
|
@Keep
|
|
39
42
|
@Suppress("unused")
|
|
40
43
|
@JvmStatic
|
|
41
|
-
private fun fromCpp(accessToken: String, isSub: Boolean?, packageName: String,
|
|
42
|
-
return
|
|
44
|
+
private fun fromCpp(accessToken: String, isSub: Boolean?, packageName: String, purchaseToken: String, sku: String): NitroReceiptValidationGoogleOptions {
|
|
45
|
+
return NitroReceiptValidationGoogleOptions(accessToken, isSub, packageName, purchaseToken, sku)
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroReceiptValidationHorizonOptions.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 "NitroReceiptValidationHorizonOptions".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class NitroReceiptValidationHorizonOptions(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val accessToken: String,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val sku: String,
|
|
26
|
+
@DoNotStrip
|
|
27
|
+
@Keep
|
|
28
|
+
val userId: String
|
|
29
|
+
) {
|
|
30
|
+
private companion object {
|
|
31
|
+
/**
|
|
32
|
+
* Constructor called from C++
|
|
33
|
+
*/
|
|
34
|
+
@DoNotStrip
|
|
35
|
+
@Keep
|
|
36
|
+
@Suppress("unused")
|
|
37
|
+
@JvmStatic
|
|
38
|
+
private fun fromCpp(accessToken: String, sku: String, userId: String): NitroReceiptValidationHorizonOptions {
|
|
39
|
+
return NitroReceiptValidationHorizonOptions(accessToken, sku, userId)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationParams.kt
CHANGED
|
@@ -19,10 +19,13 @@ import com.facebook.proguard.annotations.DoNotStrip
|
|
|
19
19
|
data class NitroReceiptValidationParams(
|
|
20
20
|
@DoNotStrip
|
|
21
21
|
@Keep
|
|
22
|
-
val
|
|
22
|
+
val apple: NitroReceiptValidationAppleOptions?,
|
|
23
23
|
@DoNotStrip
|
|
24
24
|
@Keep
|
|
25
|
-
val
|
|
25
|
+
val google: NitroReceiptValidationGoogleOptions?,
|
|
26
|
+
@DoNotStrip
|
|
27
|
+
@Keep
|
|
28
|
+
val horizon: NitroReceiptValidationHorizonOptions?
|
|
26
29
|
) {
|
|
27
30
|
private companion object {
|
|
28
31
|
/**
|
|
@@ -32,8 +35,8 @@ data class NitroReceiptValidationParams(
|
|
|
32
35
|
@Keep
|
|
33
36
|
@Suppress("unused")
|
|
34
37
|
@JvmStatic
|
|
35
|
-
private fun fromCpp(
|
|
36
|
-
return NitroReceiptValidationParams(
|
|
38
|
+
private fun fromCpp(apple: NitroReceiptValidationAppleOptions?, google: NitroReceiptValidationGoogleOptions?, horizon: NitroReceiptValidationHorizonOptions?): NitroReceiptValidationParams {
|
|
39
|
+
return NitroReceiptValidationParams(apple, google, horizon)
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
42
|
}
|
|
@@ -64,8 +64,12 @@ namespace margelo::nitro::iap { struct NitroProduct; }
|
|
|
64
64
|
namespace margelo::nitro::iap { struct NitroPurchaseResult; }
|
|
65
65
|
// Forward declaration of `NitroPurchase` to properly resolve imports.
|
|
66
66
|
namespace margelo::nitro::iap { struct NitroPurchase; }
|
|
67
|
-
// Forward declaration of `
|
|
68
|
-
namespace margelo::nitro::iap { struct
|
|
67
|
+
// Forward declaration of `NitroReceiptValidationAppleOptions` to properly resolve imports.
|
|
68
|
+
namespace margelo::nitro::iap { struct NitroReceiptValidationAppleOptions; }
|
|
69
|
+
// Forward declaration of `NitroReceiptValidationGoogleOptions` to properly resolve imports.
|
|
70
|
+
namespace margelo::nitro::iap { struct NitroReceiptValidationGoogleOptions; }
|
|
71
|
+
// Forward declaration of `NitroReceiptValidationHorizonOptions` to properly resolve imports.
|
|
72
|
+
namespace margelo::nitro::iap { struct NitroReceiptValidationHorizonOptions; }
|
|
69
73
|
// Forward declaration of `NitroReceiptValidationResultAndroid` to properly resolve imports.
|
|
70
74
|
namespace margelo::nitro::iap { struct NitroReceiptValidationResultAndroid; }
|
|
71
75
|
// Forward declaration of `NitroReceiptValidationResultIOS` to properly resolve imports.
|
|
@@ -146,7 +150,9 @@ namespace NitroIap { class HybridRnIapSpec_cxx; }
|
|
|
146
150
|
#include "NitroProduct.hpp"
|
|
147
151
|
#include "NitroPurchase.hpp"
|
|
148
152
|
#include "NitroPurchaseResult.hpp"
|
|
149
|
-
#include "
|
|
153
|
+
#include "NitroReceiptValidationAppleOptions.hpp"
|
|
154
|
+
#include "NitroReceiptValidationGoogleOptions.hpp"
|
|
155
|
+
#include "NitroReceiptValidationHorizonOptions.hpp"
|
|
150
156
|
#include "NitroReceiptValidationResultAndroid.hpp"
|
|
151
157
|
#include "NitroReceiptValidationResultIOS.hpp"
|
|
152
158
|
#include "NitroRenewalInfoIOS.hpp"
|
|
@@ -1419,18 +1425,48 @@ namespace margelo::nitro::iap::bridge::swift {
|
|
|
1419
1425
|
return Func_void_std__variant_NitroReceiptValidationResultIOS__NitroReceiptValidationResultAndroid__Wrapper(std::move(value));
|
|
1420
1426
|
}
|
|
1421
1427
|
|
|
1422
|
-
// pragma MARK: std::optional<
|
|
1428
|
+
// pragma MARK: std::optional<NitroReceiptValidationAppleOptions>
|
|
1423
1429
|
/**
|
|
1424
|
-
* Specialized version of `std::optional<
|
|
1430
|
+
* Specialized version of `std::optional<NitroReceiptValidationAppleOptions>`.
|
|
1425
1431
|
*/
|
|
1426
|
-
using
|
|
1427
|
-
inline std::optional<
|
|
1428
|
-
return std::optional<
|
|
1432
|
+
using std__optional_NitroReceiptValidationAppleOptions_ = std::optional<NitroReceiptValidationAppleOptions>;
|
|
1433
|
+
inline std::optional<NitroReceiptValidationAppleOptions> create_std__optional_NitroReceiptValidationAppleOptions_(const NitroReceiptValidationAppleOptions& value) noexcept {
|
|
1434
|
+
return std::optional<NitroReceiptValidationAppleOptions>(value);
|
|
1429
1435
|
}
|
|
1430
|
-
inline bool
|
|
1436
|
+
inline bool has_value_std__optional_NitroReceiptValidationAppleOptions_(const std::optional<NitroReceiptValidationAppleOptions>& optional) noexcept {
|
|
1431
1437
|
return optional.has_value();
|
|
1432
1438
|
}
|
|
1433
|
-
inline
|
|
1439
|
+
inline NitroReceiptValidationAppleOptions get_std__optional_NitroReceiptValidationAppleOptions_(const std::optional<NitroReceiptValidationAppleOptions>& optional) noexcept {
|
|
1440
|
+
return *optional;
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
// pragma MARK: std::optional<NitroReceiptValidationGoogleOptions>
|
|
1444
|
+
/**
|
|
1445
|
+
* Specialized version of `std::optional<NitroReceiptValidationGoogleOptions>`.
|
|
1446
|
+
*/
|
|
1447
|
+
using std__optional_NitroReceiptValidationGoogleOptions_ = std::optional<NitroReceiptValidationGoogleOptions>;
|
|
1448
|
+
inline std::optional<NitroReceiptValidationGoogleOptions> create_std__optional_NitroReceiptValidationGoogleOptions_(const NitroReceiptValidationGoogleOptions& value) noexcept {
|
|
1449
|
+
return std::optional<NitroReceiptValidationGoogleOptions>(value);
|
|
1450
|
+
}
|
|
1451
|
+
inline bool has_value_std__optional_NitroReceiptValidationGoogleOptions_(const std::optional<NitroReceiptValidationGoogleOptions>& optional) noexcept {
|
|
1452
|
+
return optional.has_value();
|
|
1453
|
+
}
|
|
1454
|
+
inline NitroReceiptValidationGoogleOptions get_std__optional_NitroReceiptValidationGoogleOptions_(const std::optional<NitroReceiptValidationGoogleOptions>& optional) noexcept {
|
|
1455
|
+
return *optional;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
// pragma MARK: std::optional<NitroReceiptValidationHorizonOptions>
|
|
1459
|
+
/**
|
|
1460
|
+
* Specialized version of `std::optional<NitroReceiptValidationHorizonOptions>`.
|
|
1461
|
+
*/
|
|
1462
|
+
using std__optional_NitroReceiptValidationHorizonOptions_ = std::optional<NitroReceiptValidationHorizonOptions>;
|
|
1463
|
+
inline std::optional<NitroReceiptValidationHorizonOptions> create_std__optional_NitroReceiptValidationHorizonOptions_(const NitroReceiptValidationHorizonOptions& value) noexcept {
|
|
1464
|
+
return std::optional<NitroReceiptValidationHorizonOptions>(value);
|
|
1465
|
+
}
|
|
1466
|
+
inline bool has_value_std__optional_NitroReceiptValidationHorizonOptions_(const std::optional<NitroReceiptValidationHorizonOptions>& optional) noexcept {
|
|
1467
|
+
return optional.has_value();
|
|
1468
|
+
}
|
|
1469
|
+
inline NitroReceiptValidationHorizonOptions get_std__optional_NitroReceiptValidationHorizonOptions_(const std::optional<NitroReceiptValidationHorizonOptions>& optional) noexcept {
|
|
1434
1470
|
return *optional;
|
|
1435
1471
|
}
|
|
1436
1472
|
|
|
@@ -76,8 +76,12 @@ namespace margelo::nitro::iap { struct NitroPurchaseRequest; }
|
|
|
76
76
|
namespace margelo::nitro::iap { struct NitroPurchaseResult; }
|
|
77
77
|
// Forward declaration of `NitroPurchase` to properly resolve imports.
|
|
78
78
|
namespace margelo::nitro::iap { struct NitroPurchase; }
|
|
79
|
-
// Forward declaration of `
|
|
80
|
-
namespace margelo::nitro::iap { struct
|
|
79
|
+
// Forward declaration of `NitroReceiptValidationAppleOptions` to properly resolve imports.
|
|
80
|
+
namespace margelo::nitro::iap { struct NitroReceiptValidationAppleOptions; }
|
|
81
|
+
// Forward declaration of `NitroReceiptValidationGoogleOptions` to properly resolve imports.
|
|
82
|
+
namespace margelo::nitro::iap { struct NitroReceiptValidationGoogleOptions; }
|
|
83
|
+
// Forward declaration of `NitroReceiptValidationHorizonOptions` to properly resolve imports.
|
|
84
|
+
namespace margelo::nitro::iap { struct NitroReceiptValidationHorizonOptions; }
|
|
81
85
|
// Forward declaration of `NitroReceiptValidationParams` to properly resolve imports.
|
|
82
86
|
namespace margelo::nitro::iap { struct NitroReceiptValidationParams; }
|
|
83
87
|
// Forward declaration of `NitroReceiptValidationResultAndroid` to properly resolve imports.
|
|
@@ -164,7 +168,9 @@ namespace margelo::nitro::iap { struct UserChoiceBillingDetails; }
|
|
|
164
168
|
#include "NitroPurchase.hpp"
|
|
165
169
|
#include "NitroPurchaseRequest.hpp"
|
|
166
170
|
#include "NitroPurchaseResult.hpp"
|
|
167
|
-
#include "
|
|
171
|
+
#include "NitroReceiptValidationAppleOptions.hpp"
|
|
172
|
+
#include "NitroReceiptValidationGoogleOptions.hpp"
|
|
173
|
+
#include "NitroReceiptValidationHorizonOptions.hpp"
|
|
168
174
|
#include "NitroReceiptValidationParams.hpp"
|
|
169
175
|
#include "NitroReceiptValidationResultAndroid.hpp"
|
|
170
176
|
#include "NitroReceiptValidationResultIOS.hpp"
|
|
@@ -88,8 +88,12 @@ namespace margelo::nitro::iap { struct NitroReceiptValidationResultIOS; }
|
|
|
88
88
|
namespace margelo::nitro::iap { struct NitroReceiptValidationResultAndroid; }
|
|
89
89
|
// Forward declaration of `NitroReceiptValidationParams` to properly resolve imports.
|
|
90
90
|
namespace margelo::nitro::iap { struct NitroReceiptValidationParams; }
|
|
91
|
-
// Forward declaration of `
|
|
92
|
-
namespace margelo::nitro::iap { struct
|
|
91
|
+
// Forward declaration of `NitroReceiptValidationAppleOptions` to properly resolve imports.
|
|
92
|
+
namespace margelo::nitro::iap { struct NitroReceiptValidationAppleOptions; }
|
|
93
|
+
// Forward declaration of `NitroReceiptValidationGoogleOptions` to properly resolve imports.
|
|
94
|
+
namespace margelo::nitro::iap { struct NitroReceiptValidationGoogleOptions; }
|
|
95
|
+
// Forward declaration of `NitroReceiptValidationHorizonOptions` to properly resolve imports.
|
|
96
|
+
namespace margelo::nitro::iap { struct NitroReceiptValidationHorizonOptions; }
|
|
93
97
|
// Forward declaration of `NitroVerifyPurchaseWithProviderResult` to properly resolve imports.
|
|
94
98
|
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithProviderResult; }
|
|
95
99
|
// Forward declaration of `NitroVerifyPurchaseWithIapkitResult` to properly resolve imports.
|
|
@@ -176,7 +180,9 @@ namespace margelo::nitro::iap { struct ExternalPurchaseLinkResultIOS; }
|
|
|
176
180
|
#include "NitroReceiptValidationResultIOS.hpp"
|
|
177
181
|
#include "NitroReceiptValidationResultAndroid.hpp"
|
|
178
182
|
#include "NitroReceiptValidationParams.hpp"
|
|
179
|
-
#include "
|
|
183
|
+
#include "NitroReceiptValidationAppleOptions.hpp"
|
|
184
|
+
#include "NitroReceiptValidationGoogleOptions.hpp"
|
|
185
|
+
#include "NitroReceiptValidationHorizonOptions.hpp"
|
|
180
186
|
#include "NitroVerifyPurchaseWithProviderResult.hpp"
|
|
181
187
|
#include "NitroVerifyPurchaseWithIapkitResult.hpp"
|
|
182
188
|
#include "IapkitPurchaseState.hpp"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroReceiptValidationAppleOptions.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `NitroReceiptValidationAppleOptions`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias NitroReceiptValidationAppleOptions = margelo.nitro.iap.NitroReceiptValidationAppleOptions
|
|
14
|
+
|
|
15
|
+
public extension NitroReceiptValidationAppleOptions {
|
|
16
|
+
private typealias bridge = margelo.nitro.iap.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `NitroReceiptValidationAppleOptions`.
|
|
20
|
+
*/
|
|
21
|
+
init(sku: String) {
|
|
22
|
+
self.init(std.string(sku))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var sku: String {
|
|
26
|
+
@inline(__always)
|
|
27
|
+
get {
|
|
28
|
+
return String(self.__sku)
|
|
29
|
+
}
|
|
30
|
+
@inline(__always)
|
|
31
|
+
set {
|
|
32
|
+
self.__sku = std.string(newValue)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// NitroReceiptValidationGoogleOptions.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
|
|
@@ -8,24 +8,24 @@
|
|
|
8
8
|
import NitroModules
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* Represents an instance of `
|
|
11
|
+
* Represents an instance of `NitroReceiptValidationGoogleOptions`, backed by a C++ struct.
|
|
12
12
|
*/
|
|
13
|
-
public typealias
|
|
13
|
+
public typealias NitroReceiptValidationGoogleOptions = margelo.nitro.iap.NitroReceiptValidationGoogleOptions
|
|
14
14
|
|
|
15
|
-
public extension
|
|
15
|
+
public extension NitroReceiptValidationGoogleOptions {
|
|
16
16
|
private typealias bridge = margelo.nitro.iap.bridge.swift
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* Create a new instance of `
|
|
19
|
+
* Create a new instance of `NitroReceiptValidationGoogleOptions`.
|
|
20
20
|
*/
|
|
21
|
-
init(accessToken: String, isSub: Bool?, packageName: String,
|
|
21
|
+
init(accessToken: String, isSub: Bool?, packageName: String, purchaseToken: String, sku: String) {
|
|
22
22
|
self.init(std.string(accessToken), { () -> bridge.std__optional_bool_ in
|
|
23
23
|
if let __unwrappedValue = isSub {
|
|
24
24
|
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
25
25
|
} else {
|
|
26
26
|
return .init()
|
|
27
27
|
}
|
|
28
|
-
}(), std.string(packageName), std.string(
|
|
28
|
+
}(), std.string(packageName), std.string(purchaseToken), std.string(sku))
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
var accessToken: String {
|
|
@@ -74,14 +74,25 @@ public extension NitroReceiptValidationAndroidOptions {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
var
|
|
77
|
+
var purchaseToken: String {
|
|
78
78
|
@inline(__always)
|
|
79
79
|
get {
|
|
80
|
-
return String(self.
|
|
80
|
+
return String(self.__purchaseToken)
|
|
81
81
|
}
|
|
82
82
|
@inline(__always)
|
|
83
83
|
set {
|
|
84
|
-
self.
|
|
84
|
+
self.__purchaseToken = std.string(newValue)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
var sku: String {
|
|
89
|
+
@inline(__always)
|
|
90
|
+
get {
|
|
91
|
+
return String(self.__sku)
|
|
92
|
+
}
|
|
93
|
+
@inline(__always)
|
|
94
|
+
set {
|
|
95
|
+
self.__sku = std.string(newValue)
|
|
85
96
|
}
|
|
86
97
|
}
|
|
87
98
|
}
|