react-native-iap 14.5.1-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 +198 -36
- package/ios/HybridRnIap.swift +32 -2
- package/lib/module/hooks/useIAP.js +1 -6
- package/lib/module/hooks/useIAP.js.map +1 -1
- package/lib/module/index.js +228 -10
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js +116 -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 +144 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/RnIap.nitro.d.ts +90 -8
- package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +194 -10
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JBillingProgramAndroid.hpp +62 -0
- package/nitrogen/generated/android/c++/JExternalLinkLaunchModeAndroid.hpp +62 -0
- package/nitrogen/generated/android/c++/JExternalLinkTypeAndroid.hpp +62 -0
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +88 -4
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.hpp +4 -0
- package/nitrogen/generated/android/c++/JNitroBillingProgramAvailabilityResultAndroid.hpp +62 -0
- package/nitrogen/generated/android/c++/JNitroBillingProgramReportingDetailsAndroid.hpp +63 -0
- package/nitrogen/generated/android/c++/JNitroLaunchExternalLinkParamsAndroid.hpp +75 -0
- 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/BillingProgramAndroid.kt +22 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/ExternalLinkLaunchModeAndroid.kt +22 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/ExternalLinkTypeAndroid.kt +22 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +16 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroBillingProgramAvailabilityResultAndroid.kt +39 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroBillingProgramReportingDetailsAndroid.kt +39 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroLaunchExternalLinkParamsAndroid.kt +45 -0
- 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.cpp +16 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +141 -10
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +27 -3
- package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +57 -3
- package/nitrogen/generated/ios/swift/BillingProgramAndroid.swift +44 -0
- package/nitrogen/generated/ios/swift/ExternalLinkLaunchModeAndroid.swift +44 -0
- package/nitrogen/generated/ios/swift/ExternalLinkTypeAndroid.swift +44 -0
- package/nitrogen/generated/ios/swift/Func_void_NitroBillingProgramAvailabilityResultAndroid.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_NitroBillingProgramReportingDetailsAndroid.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +4 -0
- package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +68 -0
- package/nitrogen/generated/ios/swift/NitroBillingProgramAvailabilityResultAndroid.swift +46 -0
- package/nitrogen/generated/ios/swift/NitroBillingProgramReportingDetailsAndroid.swift +46 -0
- package/nitrogen/generated/ios/swift/NitroLaunchExternalLinkParamsAndroid.swift +68 -0
- 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++/BillingProgramAndroid.hpp +80 -0
- package/nitrogen/generated/shared/c++/ExternalLinkLaunchModeAndroid.hpp +80 -0
- package/nitrogen/generated/shared/c++/ExternalLinkTypeAndroid.hpp +80 -0
- package/nitrogen/generated/shared/c++/HybridRnIapSpec.cpp +4 -0
- package/nitrogen/generated/shared/c++/HybridRnIapSpec.hpp +16 -0
- package/nitrogen/generated/shared/c++/NitroBillingProgramAvailabilityResultAndroid.hpp +80 -0
- package/nitrogen/generated/shared/c++/NitroBillingProgramReportingDetailsAndroid.hpp +81 -0
- package/nitrogen/generated/shared/c++/NitroLaunchExternalLinkParamsAndroid.hpp +95 -0
- 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 +297 -14
- package/src/specs/RnIap.nitro.ts +125 -10
- package/src/types.ts +207 -10
|
@@ -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,22 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// BillingProgramAndroid.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 "BillingProgramAndroid".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class BillingProgramAndroid(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
UNSPECIFIED(0),
|
|
20
|
+
EXTERNAL_CONTENT_LINK(1),
|
|
21
|
+
EXTERNAL_OFFER(2);
|
|
22
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/ExternalLinkLaunchModeAndroid.kt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ExternalLinkLaunchModeAndroid.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 "ExternalLinkLaunchModeAndroid".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class ExternalLinkLaunchModeAndroid(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
UNSPECIFIED(0),
|
|
20
|
+
LAUNCH_IN_EXTERNAL_BROWSER_OR_APP(1),
|
|
21
|
+
CALLER_WILL_LAUNCH_LINK(2);
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ExternalLinkTypeAndroid.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 "ExternalLinkTypeAndroid".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class ExternalLinkTypeAndroid(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
UNSPECIFIED(0),
|
|
20
|
+
LINK_TO_DIGITAL_CONTENT_OFFER(1),
|
|
21
|
+
LINK_TO_APP_DOWNLOAD(2);
|
|
22
|
+
}
|
|
@@ -257,6 +257,22 @@ abstract class HybridRnIapSpec: HybridObject() {
|
|
|
257
257
|
return __result
|
|
258
258
|
}
|
|
259
259
|
|
|
260
|
+
@DoNotStrip
|
|
261
|
+
@Keep
|
|
262
|
+
abstract fun enableBillingProgramAndroid(program: BillingProgramAndroid): Unit
|
|
263
|
+
|
|
264
|
+
@DoNotStrip
|
|
265
|
+
@Keep
|
|
266
|
+
abstract fun isBillingProgramAvailableAndroid(program: BillingProgramAndroid): Promise<NitroBillingProgramAvailabilityResultAndroid>
|
|
267
|
+
|
|
268
|
+
@DoNotStrip
|
|
269
|
+
@Keep
|
|
270
|
+
abstract fun createBillingProgramReportingDetailsAndroid(program: BillingProgramAndroid): Promise<NitroBillingProgramReportingDetailsAndroid>
|
|
271
|
+
|
|
272
|
+
@DoNotStrip
|
|
273
|
+
@Keep
|
|
274
|
+
abstract fun launchExternalLinkAndroid(params: NitroLaunchExternalLinkParamsAndroid): Promise<Boolean>
|
|
275
|
+
|
|
260
276
|
@DoNotStrip
|
|
261
277
|
@Keep
|
|
262
278
|
abstract fun canPresentExternalPurchaseNoticeIOS(): Promise<Boolean>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroBillingProgramAvailabilityResultAndroid.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 "NitroBillingProgramAvailabilityResultAndroid".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class NitroBillingProgramAvailabilityResultAndroid(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val billingProgram: BillingProgramAndroid,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val isAvailable: Boolean
|
|
26
|
+
) {
|
|
27
|
+
private companion object {
|
|
28
|
+
/**
|
|
29
|
+
* Constructor called from C++
|
|
30
|
+
*/
|
|
31
|
+
@DoNotStrip
|
|
32
|
+
@Keep
|
|
33
|
+
@Suppress("unused")
|
|
34
|
+
@JvmStatic
|
|
35
|
+
private fun fromCpp(billingProgram: BillingProgramAndroid, isAvailable: Boolean): NitroBillingProgramAvailabilityResultAndroid {
|
|
36
|
+
return NitroBillingProgramAvailabilityResultAndroid(billingProgram, isAvailable)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroBillingProgramReportingDetailsAndroid.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 "NitroBillingProgramReportingDetailsAndroid".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class NitroBillingProgramReportingDetailsAndroid(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val billingProgram: BillingProgramAndroid,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val externalTransactionToken: String
|
|
26
|
+
) {
|
|
27
|
+
private companion object {
|
|
28
|
+
/**
|
|
29
|
+
* Constructor called from C++
|
|
30
|
+
*/
|
|
31
|
+
@DoNotStrip
|
|
32
|
+
@Keep
|
|
33
|
+
@Suppress("unused")
|
|
34
|
+
@JvmStatic
|
|
35
|
+
private fun fromCpp(billingProgram: BillingProgramAndroid, externalTransactionToken: String): NitroBillingProgramReportingDetailsAndroid {
|
|
36
|
+
return NitroBillingProgramReportingDetailsAndroid(billingProgram, externalTransactionToken)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroLaunchExternalLinkParamsAndroid.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 "NitroLaunchExternalLinkParamsAndroid".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class NitroLaunchExternalLinkParamsAndroid(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val billingProgram: BillingProgramAndroid,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val launchMode: ExternalLinkLaunchModeAndroid,
|
|
26
|
+
@DoNotStrip
|
|
27
|
+
@Keep
|
|
28
|
+
val linkType: ExternalLinkTypeAndroid,
|
|
29
|
+
@DoNotStrip
|
|
30
|
+
@Keep
|
|
31
|
+
val linkUri: String
|
|
32
|
+
) {
|
|
33
|
+
private companion object {
|
|
34
|
+
/**
|
|
35
|
+
* Constructor called from C++
|
|
36
|
+
*/
|
|
37
|
+
@DoNotStrip
|
|
38
|
+
@Keep
|
|
39
|
+
@Suppress("unused")
|
|
40
|
+
@JvmStatic
|
|
41
|
+
private fun fromCpp(billingProgram: BillingProgramAndroid, launchMode: ExternalLinkLaunchModeAndroid, linkType: ExternalLinkTypeAndroid, linkUri: String): NitroLaunchExternalLinkParamsAndroid {
|
|
42
|
+
return NitroLaunchExternalLinkParamsAndroid(billingProgram, launchMode, linkType, linkUri)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -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
|
}
|
|
@@ -165,6 +165,22 @@ namespace margelo::nitro::iap::bridge::swift {
|
|
|
165
165
|
};
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
// pragma MARK: std::function<void(const NitroBillingProgramAvailabilityResultAndroid& /* result */)>
|
|
169
|
+
Func_void_NitroBillingProgramAvailabilityResultAndroid create_Func_void_NitroBillingProgramAvailabilityResultAndroid(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
170
|
+
auto swiftClosure = NitroIap::Func_void_NitroBillingProgramAvailabilityResultAndroid::fromUnsafe(swiftClosureWrapper);
|
|
171
|
+
return [swiftClosure = std::move(swiftClosure)](const NitroBillingProgramAvailabilityResultAndroid& result) mutable -> void {
|
|
172
|
+
swiftClosure.call(result);
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// pragma MARK: std::function<void(const NitroBillingProgramReportingDetailsAndroid& /* result */)>
|
|
177
|
+
Func_void_NitroBillingProgramReportingDetailsAndroid create_Func_void_NitroBillingProgramReportingDetailsAndroid(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
178
|
+
auto swiftClosure = NitroIap::Func_void_NitroBillingProgramReportingDetailsAndroid::fromUnsafe(swiftClosureWrapper);
|
|
179
|
+
return [swiftClosure = std::move(swiftClosure)](const NitroBillingProgramReportingDetailsAndroid& result) mutable -> void {
|
|
180
|
+
swiftClosure.call(result);
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
168
184
|
// pragma MARK: std::function<void(const ExternalPurchaseNoticeResultIOS& /* result */)>
|
|
169
185
|
Func_void_ExternalPurchaseNoticeResultIOS create_Func_void_ExternalPurchaseNoticeResultIOS(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
170
186
|
auto swiftClosure = NitroIap::Func_void_ExternalPurchaseNoticeResultIOS::fromUnsafe(swiftClosureWrapper);
|