securiti-consent-sdk 1.132.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/NitroSecuritiConsentSdk.podspec +37 -0
- package/README.md +45 -0
- package/android/CMakeLists.txt +29 -0
- package/android/build.gradle +146 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/securiticonsentsdk/HybridConsentSDK.kt +669 -0
- package/android/src/main/java/com/margelo/nitro/securiticonsentsdk/NitroSecuritiConsentSdkPackage.java +33 -0
- package/ios/Bridge.h +10 -0
- package/ios/HybridConsentSDK.swift +640 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/NitroSecuritiConsentSdk+autolinking.cmake +78 -0
- package/nitrogen/generated/android/NitroSecuritiConsentSdk+autolinking.gradle +27 -0
- package/nitrogen/generated/android/NitroSecuritiConsentSdkOnLoad.cpp +48 -0
- package/nitrogen/generated/android/NitroSecuritiConsentSdkOnLoad.hpp +25 -0
- package/nitrogen/generated/android/c++/JAppPermission.hpp +86 -0
- package/nitrogen/generated/android/c++/JBannerConfig.hpp +194 -0
- package/nitrogen/generated/android/c++/JCmpSDKOptions.hpp +94 -0
- package/nitrogen/generated/android/c++/JCustomColors.hpp +82 -0
- package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +74 -0
- package/nitrogen/generated/android/c++/JHybridConsentSDKSpec.cpp +277 -0
- package/nitrogen/generated/android/c++/JHybridConsentSDKSpec.hpp +78 -0
- package/nitrogen/generated/android/c++/JPermissionConsent.hpp +61 -0
- package/nitrogen/generated/android/c++/JPostConsentsRequest.hpp +137 -0
- package/nitrogen/generated/android/c++/JPurpose.hpp +118 -0
- package/nitrogen/generated/android/c++/JPurposeConsent.hpp +65 -0
- package/nitrogen/generated/android/c++/JSDK.hpp +104 -0
- package/nitrogen/generated/android/c++/JSettingsPrompt.hpp +88 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/AppPermission.kt +34 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/BannerConfig.kt +57 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/CmpSDKOptions.kt +36 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/CustomColors.kt +33 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/Func_void_bool.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/HybridConsentSDKSpec.kt +121 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/NitroSecuritiConsentSdkOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/PermissionConsent.kt +28 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/PostConsentsRequest.kt +37 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/Purpose.kt +37 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/PurposeConsent.kt +29 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/SDK.kt +34 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/SettingsPrompt.kt +30 -0
- package/nitrogen/generated/ios/NitroSecuritiConsentSdk+autolinking.rb +60 -0
- package/nitrogen/generated/ios/NitroSecuritiConsentSdk-Swift-Cxx-Bridge.cpp +96 -0
- package/nitrogen/generated/ios/NitroSecuritiConsentSdk-Swift-Cxx-Bridge.hpp +604 -0
- package/nitrogen/generated/ios/NitroSecuritiConsentSdk-Swift-Cxx-Umbrella.hpp +78 -0
- package/nitrogen/generated/ios/NitroSecuritiConsentSdkAutolinking.mm +33 -0
- package/nitrogen/generated/ios/NitroSecuritiConsentSdkAutolinking.swift +25 -0
- package/nitrogen/generated/ios/c++/HybridConsentSDKSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridConsentSDKSpecSwift.hpp +223 -0
- package/nitrogen/generated/ios/swift/AppPermission.swift +267 -0
- package/nitrogen/generated/ios/swift/BannerConfig.swift +918 -0
- package/nitrogen/generated/ios/swift/CmpSDKOptions.swift +217 -0
- package/nitrogen/generated/ios/swift/CustomColors.swift +256 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_BannerConfig_.swift +52 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_SettingsPrompt_.swift +52 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_AppPermission_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_Purpose_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_SDK_.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridConsentSDKSpec.swift +64 -0
- package/nitrogen/generated/ios/swift/HybridConsentSDKSpec_cxx.swift +398 -0
- package/nitrogen/generated/ios/swift/PermissionConsent.swift +57 -0
- package/nitrogen/generated/ios/swift/PostConsentsRequest.swift +216 -0
- package/nitrogen/generated/ios/swift/Purpose.swift +354 -0
- package/nitrogen/generated/ios/swift/PurposeConsent.swift +68 -0
- package/nitrogen/generated/ios/swift/SDK.swift +285 -0
- package/nitrogen/generated/ios/swift/SettingsPrompt.swift +181 -0
- package/nitrogen/generated/shared/c++/AppPermission.hpp +102 -0
- package/nitrogen/generated/shared/c++/BannerConfig.hpp +197 -0
- package/nitrogen/generated/shared/c++/CmpSDKOptions.hpp +110 -0
- package/nitrogen/generated/shared/c++/CustomColors.hpp +98 -0
- package/nitrogen/generated/shared/c++/HybridConsentSDKSpec.cpp +37 -0
- package/nitrogen/generated/shared/c++/HybridConsentSDKSpec.hpp +102 -0
- package/nitrogen/generated/shared/c++/PermissionConsent.hpp +77 -0
- package/nitrogen/generated/shared/c++/PostConsentsRequest.hpp +120 -0
- package/nitrogen/generated/shared/c++/Purpose.hpp +117 -0
- package/nitrogen/generated/shared/c++/PurposeConsent.hpp +81 -0
- package/nitrogen/generated/shared/c++/SDK.hpp +103 -0
- package/nitrogen/generated/shared/c++/SettingsPrompt.hpp +87 -0
- package/package.json +107 -0
- package/react-native.config.js +16 -0
- package/src/ConsentSDK.nitro.ts +232 -0
- package/src/index.ts +133 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_bool.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 <functional>
|
|
12
|
+
|
|
13
|
+
#include <functional>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Represents the Java/Kotlin callback `(isReady: Boolean) -> Unit`.
|
|
21
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
22
|
+
*/
|
|
23
|
+
struct JFunc_void_bool: public jni::JavaClass<JFunc_void_bool> {
|
|
24
|
+
public:
|
|
25
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/securiticonsentsdk/Func_void_bool;";
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
/**
|
|
29
|
+
* Invokes the function this `JFunc_void_bool` instance holds through JNI.
|
|
30
|
+
*/
|
|
31
|
+
void invoke(bool isReady) const {
|
|
32
|
+
static const auto method = javaClassStatic()->getMethod<void(jboolean /* isReady */)>("invoke");
|
|
33
|
+
method(self(), isReady);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* An implementation of Func_void_bool that is backed by a C++ implementation (using `std::function<...>`)
|
|
39
|
+
*/
|
|
40
|
+
struct JFunc_void_bool_cxx final: public jni::HybridClass<JFunc_void_bool_cxx, JFunc_void_bool> {
|
|
41
|
+
public:
|
|
42
|
+
static jni::local_ref<JFunc_void_bool::javaobject> fromCpp(const std::function<void(bool /* isReady */)>& func) {
|
|
43
|
+
return JFunc_void_bool_cxx::newObjectCxxArgs(func);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
/**
|
|
48
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_bool_cxx` instance holds.
|
|
49
|
+
*/
|
|
50
|
+
void invoke_cxx(jboolean isReady) {
|
|
51
|
+
_func(static_cast<bool>(isReady));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public:
|
|
55
|
+
[[nodiscard]]
|
|
56
|
+
inline const std::function<void(bool /* isReady */)>& getFunction() const {
|
|
57
|
+
return _func;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public:
|
|
61
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/securiticonsentsdk/Func_void_bool_cxx;";
|
|
62
|
+
static void registerNatives() {
|
|
63
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_bool_cxx::invoke_cxx)});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
private:
|
|
67
|
+
explicit JFunc_void_bool_cxx(const std::function<void(bool /* isReady */)>& func): _func(func) { }
|
|
68
|
+
|
|
69
|
+
private:
|
|
70
|
+
friend HybridBase;
|
|
71
|
+
std::function<void(bool /* isReady */)> _func;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
} // namespace margelo::nitro::securiticonsentsdk
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridConsentSDKSpec.cpp
|
|
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
|
+
#include "JHybridConsentSDKSpec.hpp"
|
|
9
|
+
|
|
10
|
+
// Forward declaration of `AppPermission` to properly resolve imports.
|
|
11
|
+
namespace margelo::nitro::securiticonsentsdk { struct AppPermission; }
|
|
12
|
+
// Forward declaration of `Purpose` to properly resolve imports.
|
|
13
|
+
namespace margelo::nitro::securiticonsentsdk { struct Purpose; }
|
|
14
|
+
// Forward declaration of `SDK` to properly resolve imports.
|
|
15
|
+
namespace margelo::nitro::securiticonsentsdk { struct SDK; }
|
|
16
|
+
// Forward declaration of `BannerConfig` to properly resolve imports.
|
|
17
|
+
namespace margelo::nitro::securiticonsentsdk { struct BannerConfig; }
|
|
18
|
+
// Forward declaration of `CustomColors` to properly resolve imports.
|
|
19
|
+
namespace margelo::nitro::securiticonsentsdk { struct CustomColors; }
|
|
20
|
+
// Forward declaration of `CmpSDKOptions` to properly resolve imports.
|
|
21
|
+
namespace margelo::nitro::securiticonsentsdk { struct CmpSDKOptions; }
|
|
22
|
+
// Forward declaration of `SettingsPrompt` to properly resolve imports.
|
|
23
|
+
namespace margelo::nitro::securiticonsentsdk { struct SettingsPrompt; }
|
|
24
|
+
// Forward declaration of `PostConsentsRequest` to properly resolve imports.
|
|
25
|
+
namespace margelo::nitro::securiticonsentsdk { struct PostConsentsRequest; }
|
|
26
|
+
// Forward declaration of `PurposeConsent` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::securiticonsentsdk { struct PurposeConsent; }
|
|
28
|
+
// Forward declaration of `PermissionConsent` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::securiticonsentsdk { struct PermissionConsent; }
|
|
30
|
+
|
|
31
|
+
#include <NitroModules/Promise.hpp>
|
|
32
|
+
#include <string>
|
|
33
|
+
#include <NitroModules/JPromise.hpp>
|
|
34
|
+
#include <vector>
|
|
35
|
+
#include "AppPermission.hpp"
|
|
36
|
+
#include "JAppPermission.hpp"
|
|
37
|
+
#include <optional>
|
|
38
|
+
#include "Purpose.hpp"
|
|
39
|
+
#include "JPurpose.hpp"
|
|
40
|
+
#include "SDK.hpp"
|
|
41
|
+
#include "JSDK.hpp"
|
|
42
|
+
#include "BannerConfig.hpp"
|
|
43
|
+
#include "JBannerConfig.hpp"
|
|
44
|
+
#include "CustomColors.hpp"
|
|
45
|
+
#include "JCustomColors.hpp"
|
|
46
|
+
#include <unordered_map>
|
|
47
|
+
#include "CmpSDKOptions.hpp"
|
|
48
|
+
#include "JCmpSDKOptions.hpp"
|
|
49
|
+
#include "SettingsPrompt.hpp"
|
|
50
|
+
#include "JSettingsPrompt.hpp"
|
|
51
|
+
#include <functional>
|
|
52
|
+
#include "JFunc_void_bool.hpp"
|
|
53
|
+
#include "PostConsentsRequest.hpp"
|
|
54
|
+
#include "JPostConsentsRequest.hpp"
|
|
55
|
+
#include "PurposeConsent.hpp"
|
|
56
|
+
#include "JPurposeConsent.hpp"
|
|
57
|
+
#include "PermissionConsent.hpp"
|
|
58
|
+
#include "JPermissionConsent.hpp"
|
|
59
|
+
|
|
60
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
61
|
+
|
|
62
|
+
jni::local_ref<JHybridConsentSDKSpec::jhybriddata> JHybridConsentSDKSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
63
|
+
return makeCxxInstance(jThis);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
void JHybridConsentSDKSpec::registerNatives() {
|
|
67
|
+
registerHybrid({
|
|
68
|
+
makeNativeMethod("initHybrid", JHybridConsentSDKSpec::initHybrid),
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
size_t JHybridConsentSDKSpec::getExternalMemorySize() noexcept {
|
|
73
|
+
static const auto method = javaClassStatic()->getMethod<jlong()>("getMemorySize");
|
|
74
|
+
return method(_javaPart);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Properties
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
// Methods
|
|
81
|
+
void JHybridConsentSDKSpec::initialize(const CmpSDKOptions& options) {
|
|
82
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JCmpSDKOptions> /* options */)>("initialize");
|
|
83
|
+
method(_javaPart, JCmpSDKOptions::fromCpp(options));
|
|
84
|
+
}
|
|
85
|
+
bool JHybridConsentSDKSpec::isSdkReady() {
|
|
86
|
+
static const auto method = javaClassStatic()->getMethod<jboolean()>("isSdkReady");
|
|
87
|
+
auto __result = method(_javaPart);
|
|
88
|
+
return static_cast<bool>(__result);
|
|
89
|
+
}
|
|
90
|
+
void JHybridConsentSDKSpec::presentConsentBanner() {
|
|
91
|
+
static const auto method = javaClassStatic()->getMethod<void()>("presentConsentBanner");
|
|
92
|
+
method(_javaPart);
|
|
93
|
+
}
|
|
94
|
+
void JHybridConsentSDKSpec::presentPreferenceCenter() {
|
|
95
|
+
static const auto method = javaClassStatic()->getMethod<void()>("presentPreferenceCenter");
|
|
96
|
+
method(_javaPart);
|
|
97
|
+
}
|
|
98
|
+
void JHybridConsentSDKSpec::isReady(const std::function<void(bool /* isReady */)>& callback) {
|
|
99
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_bool::javaobject> /* callback */)>("isReady_cxx");
|
|
100
|
+
method(_javaPart, JFunc_void_bool_cxx::fromCpp(callback));
|
|
101
|
+
}
|
|
102
|
+
void JHybridConsentSDKSpec::resetConsents() {
|
|
103
|
+
static const auto method = javaClassStatic()->getMethod<void()>("resetConsents");
|
|
104
|
+
method(_javaPart);
|
|
105
|
+
}
|
|
106
|
+
std::shared_ptr<Promise<std::string>> JHybridConsentSDKSpec::getConsentByPurposeId(double purposeId) {
|
|
107
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(double /* purposeId */)>("getConsentByPurposeId");
|
|
108
|
+
auto __result = method(_javaPart, purposeId);
|
|
109
|
+
return [&]() {
|
|
110
|
+
auto __promise = Promise<std::string>::create();
|
|
111
|
+
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
112
|
+
auto __result = jni::static_ref_cast<jni::JString>(__boxedResult);
|
|
113
|
+
__promise->resolve(__result->toStdString());
|
|
114
|
+
});
|
|
115
|
+
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
116
|
+
jni::JniException __jniError(__throwable);
|
|
117
|
+
__promise->reject(std::make_exception_ptr(__jniError));
|
|
118
|
+
});
|
|
119
|
+
return __promise;
|
|
120
|
+
}();
|
|
121
|
+
}
|
|
122
|
+
std::shared_ptr<Promise<std::string>> JHybridConsentSDKSpec::getConsentByPermissionId(const std::string& permissionId) {
|
|
123
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* permissionId */)>("getConsentByPermissionId");
|
|
124
|
+
auto __result = method(_javaPart, jni::make_jstring(permissionId));
|
|
125
|
+
return [&]() {
|
|
126
|
+
auto __promise = Promise<std::string>::create();
|
|
127
|
+
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
128
|
+
auto __result = jni::static_ref_cast<jni::JString>(__boxedResult);
|
|
129
|
+
__promise->resolve(__result->toStdString());
|
|
130
|
+
});
|
|
131
|
+
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
132
|
+
jni::JniException __jniError(__throwable);
|
|
133
|
+
__promise->reject(std::make_exception_ptr(__jniError));
|
|
134
|
+
});
|
|
135
|
+
return __promise;
|
|
136
|
+
}();
|
|
137
|
+
}
|
|
138
|
+
std::shared_ptr<Promise<std::vector<AppPermission>>> JHybridConsentSDKSpec::getPermissions() {
|
|
139
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("getPermissions");
|
|
140
|
+
auto __result = method(_javaPart);
|
|
141
|
+
return [&]() {
|
|
142
|
+
auto __promise = Promise<std::vector<AppPermission>>::create();
|
|
143
|
+
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
144
|
+
auto __result = jni::static_ref_cast<jni::JArrayClass<JAppPermission>>(__boxedResult);
|
|
145
|
+
__promise->resolve([&]() {
|
|
146
|
+
size_t __size = __result->size();
|
|
147
|
+
std::vector<AppPermission> __vector;
|
|
148
|
+
__vector.reserve(__size);
|
|
149
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
150
|
+
auto __element = __result->getElement(__i);
|
|
151
|
+
__vector.push_back(__element->toCpp());
|
|
152
|
+
}
|
|
153
|
+
return __vector;
|
|
154
|
+
}());
|
|
155
|
+
});
|
|
156
|
+
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
157
|
+
jni::JniException __jniError(__throwable);
|
|
158
|
+
__promise->reject(std::make_exception_ptr(__jniError));
|
|
159
|
+
});
|
|
160
|
+
return __promise;
|
|
161
|
+
}();
|
|
162
|
+
}
|
|
163
|
+
std::shared_ptr<Promise<std::vector<Purpose>>> JHybridConsentSDKSpec::getPurposes() {
|
|
164
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("getPurposes");
|
|
165
|
+
auto __result = method(_javaPart);
|
|
166
|
+
return [&]() {
|
|
167
|
+
auto __promise = Promise<std::vector<Purpose>>::create();
|
|
168
|
+
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
169
|
+
auto __result = jni::static_ref_cast<jni::JArrayClass<JPurpose>>(__boxedResult);
|
|
170
|
+
__promise->resolve([&]() {
|
|
171
|
+
size_t __size = __result->size();
|
|
172
|
+
std::vector<Purpose> __vector;
|
|
173
|
+
__vector.reserve(__size);
|
|
174
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
175
|
+
auto __element = __result->getElement(__i);
|
|
176
|
+
__vector.push_back(__element->toCpp());
|
|
177
|
+
}
|
|
178
|
+
return __vector;
|
|
179
|
+
}());
|
|
180
|
+
});
|
|
181
|
+
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
182
|
+
jni::JniException __jniError(__throwable);
|
|
183
|
+
__promise->reject(std::make_exception_ptr(__jniError));
|
|
184
|
+
});
|
|
185
|
+
return __promise;
|
|
186
|
+
}();
|
|
187
|
+
}
|
|
188
|
+
std::shared_ptr<Promise<std::vector<SDK>>> JHybridConsentSDKSpec::getSdksInPurpose(double purposeId) {
|
|
189
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(double /* purposeId */)>("getSdksInPurpose");
|
|
190
|
+
auto __result = method(_javaPart, purposeId);
|
|
191
|
+
return [&]() {
|
|
192
|
+
auto __promise = Promise<std::vector<SDK>>::create();
|
|
193
|
+
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
194
|
+
auto __result = jni::static_ref_cast<jni::JArrayClass<JSDK>>(__boxedResult);
|
|
195
|
+
__promise->resolve([&]() {
|
|
196
|
+
size_t __size = __result->size();
|
|
197
|
+
std::vector<SDK> __vector;
|
|
198
|
+
__vector.reserve(__size);
|
|
199
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
200
|
+
auto __element = __result->getElement(__i);
|
|
201
|
+
__vector.push_back(__element->toCpp());
|
|
202
|
+
}
|
|
203
|
+
return __vector;
|
|
204
|
+
}());
|
|
205
|
+
});
|
|
206
|
+
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
207
|
+
jni::JniException __jniError(__throwable);
|
|
208
|
+
__promise->reject(std::make_exception_ptr(__jniError));
|
|
209
|
+
});
|
|
210
|
+
return __promise;
|
|
211
|
+
}();
|
|
212
|
+
}
|
|
213
|
+
bool JHybridConsentSDKSpec::setPurposeConsent(const Purpose& purpose, const std::string& consent) {
|
|
214
|
+
static const auto method = javaClassStatic()->getMethod<jboolean(jni::alias_ref<JPurpose> /* purpose */, jni::alias_ref<jni::JString> /* consent */)>("setPurposeConsent");
|
|
215
|
+
auto __result = method(_javaPart, JPurpose::fromCpp(purpose), jni::make_jstring(consent));
|
|
216
|
+
return static_cast<bool>(__result);
|
|
217
|
+
}
|
|
218
|
+
bool JHybridConsentSDKSpec::setPermissionConsent(const AppPermission& permission, const std::string& consent) {
|
|
219
|
+
static const auto method = javaClassStatic()->getMethod<jboolean(jni::alias_ref<JAppPermission> /* permission */, jni::alias_ref<jni::JString> /* consent */)>("setPermissionConsent");
|
|
220
|
+
auto __result = method(_javaPart, JAppPermission::fromCpp(permission), jni::make_jstring(consent));
|
|
221
|
+
return static_cast<bool>(__result);
|
|
222
|
+
}
|
|
223
|
+
std::shared_ptr<Promise<std::optional<BannerConfig>>> JHybridConsentSDKSpec::getBannerConfig() {
|
|
224
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("getBannerConfig");
|
|
225
|
+
auto __result = method(_javaPart);
|
|
226
|
+
return [&]() {
|
|
227
|
+
auto __promise = Promise<std::optional<BannerConfig>>::create();
|
|
228
|
+
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
229
|
+
auto __result = jni::static_ref_cast<JBannerConfig>(__boxedResult);
|
|
230
|
+
__promise->resolve(__result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt);
|
|
231
|
+
});
|
|
232
|
+
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
233
|
+
jni::JniException __jniError(__throwable);
|
|
234
|
+
__promise->reject(std::make_exception_ptr(__jniError));
|
|
235
|
+
});
|
|
236
|
+
return __promise;
|
|
237
|
+
}();
|
|
238
|
+
}
|
|
239
|
+
std::optional<CmpSDKOptions> JHybridConsentSDKSpec::options() {
|
|
240
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JCmpSDKOptions>()>("options");
|
|
241
|
+
auto __result = method(_javaPart);
|
|
242
|
+
return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
|
|
243
|
+
}
|
|
244
|
+
std::shared_ptr<Promise<std::optional<SettingsPrompt>>> JHybridConsentSDKSpec::getSettingsPrompt() {
|
|
245
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("getSettingsPrompt");
|
|
246
|
+
auto __result = method(_javaPart);
|
|
247
|
+
return [&]() {
|
|
248
|
+
auto __promise = Promise<std::optional<SettingsPrompt>>::create();
|
|
249
|
+
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
250
|
+
auto __result = jni::static_ref_cast<JSettingsPrompt>(__boxedResult);
|
|
251
|
+
__promise->resolve(__result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt);
|
|
252
|
+
});
|
|
253
|
+
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
254
|
+
jni::JniException __jniError(__throwable);
|
|
255
|
+
__promise->reject(std::make_exception_ptr(__jniError));
|
|
256
|
+
});
|
|
257
|
+
return __promise;
|
|
258
|
+
}();
|
|
259
|
+
}
|
|
260
|
+
std::shared_ptr<Promise<bool>> JHybridConsentSDKSpec::uploadConsents(const PostConsentsRequest& request) {
|
|
261
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<JPostConsentsRequest> /* request */)>("uploadConsents");
|
|
262
|
+
auto __result = method(_javaPart, JPostConsentsRequest::fromCpp(request));
|
|
263
|
+
return [&]() {
|
|
264
|
+
auto __promise = Promise<bool>::create();
|
|
265
|
+
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
266
|
+
auto __result = jni::static_ref_cast<jni::JBoolean>(__boxedResult);
|
|
267
|
+
__promise->resolve(static_cast<bool>(__result->value()));
|
|
268
|
+
});
|
|
269
|
+
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
270
|
+
jni::JniException __jniError(__throwable);
|
|
271
|
+
__promise->reject(std::make_exception_ptr(__jniError));
|
|
272
|
+
});
|
|
273
|
+
return __promise;
|
|
274
|
+
}();
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
} // namespace margelo::nitro::securiticonsentsdk
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridConsentSDKSpec.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 <NitroModules/JHybridObject.hpp>
|
|
11
|
+
#include <fbjni/fbjni.h>
|
|
12
|
+
#include "HybridConsentSDKSpec.hpp"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
18
|
+
|
|
19
|
+
using namespace facebook;
|
|
20
|
+
|
|
21
|
+
class JHybridConsentSDKSpec: public jni::HybridClass<JHybridConsentSDKSpec, JHybridObject>,
|
|
22
|
+
public virtual HybridConsentSDKSpec {
|
|
23
|
+
public:
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/securiticonsentsdk/HybridConsentSDKSpec;";
|
|
25
|
+
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
|
|
26
|
+
static void registerNatives();
|
|
27
|
+
|
|
28
|
+
protected:
|
|
29
|
+
// C++ constructor (called from Java via `initHybrid()`)
|
|
30
|
+
explicit JHybridConsentSDKSpec(jni::alias_ref<jhybridobject> jThis) :
|
|
31
|
+
HybridObject(HybridConsentSDKSpec::TAG),
|
|
32
|
+
_javaPart(jni::make_global(jThis)) {}
|
|
33
|
+
|
|
34
|
+
public:
|
|
35
|
+
~JHybridConsentSDKSpec() override {
|
|
36
|
+
// Hermes GC can destroy JS objects on a non-JNI Thread.
|
|
37
|
+
jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public:
|
|
41
|
+
size_t getExternalMemorySize() noexcept override;
|
|
42
|
+
|
|
43
|
+
public:
|
|
44
|
+
inline const jni::global_ref<JHybridConsentSDKSpec::javaobject>& getJavaPart() const noexcept {
|
|
45
|
+
return _javaPart;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public:
|
|
49
|
+
// Properties
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
public:
|
|
53
|
+
// Methods
|
|
54
|
+
void initialize(const CmpSDKOptions& options) override;
|
|
55
|
+
bool isSdkReady() override;
|
|
56
|
+
void presentConsentBanner() override;
|
|
57
|
+
void presentPreferenceCenter() override;
|
|
58
|
+
void isReady(const std::function<void(bool /* isReady */)>& callback) override;
|
|
59
|
+
void resetConsents() override;
|
|
60
|
+
std::shared_ptr<Promise<std::string>> getConsentByPurposeId(double purposeId) override;
|
|
61
|
+
std::shared_ptr<Promise<std::string>> getConsentByPermissionId(const std::string& permissionId) override;
|
|
62
|
+
std::shared_ptr<Promise<std::vector<AppPermission>>> getPermissions() override;
|
|
63
|
+
std::shared_ptr<Promise<std::vector<Purpose>>> getPurposes() override;
|
|
64
|
+
std::shared_ptr<Promise<std::vector<SDK>>> getSdksInPurpose(double purposeId) override;
|
|
65
|
+
bool setPurposeConsent(const Purpose& purpose, const std::string& consent) override;
|
|
66
|
+
bool setPermissionConsent(const AppPermission& permission, const std::string& consent) override;
|
|
67
|
+
std::shared_ptr<Promise<std::optional<BannerConfig>>> getBannerConfig() override;
|
|
68
|
+
std::optional<CmpSDKOptions> options() override;
|
|
69
|
+
std::shared_ptr<Promise<std::optional<SettingsPrompt>>> getSettingsPrompt() override;
|
|
70
|
+
std::shared_ptr<Promise<bool>> uploadConsents(const PostConsentsRequest& request) override;
|
|
71
|
+
|
|
72
|
+
private:
|
|
73
|
+
friend HybridBase;
|
|
74
|
+
using HybridBase::HybridBase;
|
|
75
|
+
jni::global_ref<JHybridConsentSDKSpec::javaobject> _javaPart;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
} // namespace margelo::nitro::securiticonsentsdk
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JPermissionConsent.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 "PermissionConsent.hpp"
|
|
12
|
+
|
|
13
|
+
#include <string>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "PermissionConsent" and the the Kotlin data class "PermissionConsent".
|
|
21
|
+
*/
|
|
22
|
+
struct JPermissionConsent final: public jni::JavaClass<JPermissionConsent> {
|
|
23
|
+
public:
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/securiticonsentsdk/PermissionConsent;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct PermissionConsent by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
PermissionConsent toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldPermission = clazz->getField<jni::JString>("permission");
|
|
35
|
+
jni::local_ref<jni::JString> permission = this->getFieldValue(fieldPermission);
|
|
36
|
+
static const auto fieldConsentStatus = clazz->getField<jni::JString>("consentStatus");
|
|
37
|
+
jni::local_ref<jni::JString> consentStatus = this->getFieldValue(fieldConsentStatus);
|
|
38
|
+
static const auto fieldTimestamp = clazz->getField<double>("timestamp");
|
|
39
|
+
double timestamp = this->getFieldValue(fieldTimestamp);
|
|
40
|
+
return PermissionConsent(
|
|
41
|
+
permission->toStdString(),
|
|
42
|
+
consentStatus->toStdString(),
|
|
43
|
+
timestamp
|
|
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<JPermissionConsent::javaobject> fromCpp(const PermissionConsent& value) {
|
|
53
|
+
return newInstance(
|
|
54
|
+
jni::make_jstring(value.permission),
|
|
55
|
+
jni::make_jstring(value.consentStatus),
|
|
56
|
+
value.timestamp
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::securiticonsentsdk
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JPostConsentsRequest.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 "PostConsentsRequest.hpp"
|
|
12
|
+
|
|
13
|
+
#include "JPermissionConsent.hpp"
|
|
14
|
+
#include "JPurposeConsent.hpp"
|
|
15
|
+
#include "PermissionConsent.hpp"
|
|
16
|
+
#include "PurposeConsent.hpp"
|
|
17
|
+
#include <optional>
|
|
18
|
+
#include <string>
|
|
19
|
+
#include <vector>
|
|
20
|
+
|
|
21
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
22
|
+
|
|
23
|
+
using namespace facebook;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The C++ JNI bridge between the C++ struct "PostConsentsRequest" and the the Kotlin data class "PostConsentsRequest".
|
|
27
|
+
*/
|
|
28
|
+
struct JPostConsentsRequest final: public jni::JavaClass<JPostConsentsRequest> {
|
|
29
|
+
public:
|
|
30
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/securiticonsentsdk/PostConsentsRequest;";
|
|
31
|
+
|
|
32
|
+
public:
|
|
33
|
+
/**
|
|
34
|
+
* Convert this Java/Kotlin-based struct to the C++ struct PostConsentsRequest by copying all values to C++.
|
|
35
|
+
*/
|
|
36
|
+
[[maybe_unused]]
|
|
37
|
+
[[nodiscard]]
|
|
38
|
+
PostConsentsRequest toCpp() const {
|
|
39
|
+
static const auto clazz = javaClassStatic();
|
|
40
|
+
static const auto fieldUuid = clazz->getField<jni::JString>("uuid");
|
|
41
|
+
jni::local_ref<jni::JString> uuid = this->getFieldValue(fieldUuid);
|
|
42
|
+
static const auto fieldAppUUID = clazz->getField<jni::JString>("appUUID");
|
|
43
|
+
jni::local_ref<jni::JString> appUUID = this->getFieldValue(fieldAppUUID);
|
|
44
|
+
static const auto fieldDevice = clazz->getField<jni::JString>("device");
|
|
45
|
+
jni::local_ref<jni::JString> device = this->getFieldValue(fieldDevice);
|
|
46
|
+
static const auto fieldImplicitConsent = clazz->getField<jboolean>("implicitConsent");
|
|
47
|
+
jboolean implicitConsent = this->getFieldValue(fieldImplicitConsent);
|
|
48
|
+
static const auto fieldVersion = clazz->getField<double>("version");
|
|
49
|
+
double version = this->getFieldValue(fieldVersion);
|
|
50
|
+
static const auto fieldPurposeConsents = clazz->getField<jni::JArrayClass<JPurposeConsent>>("purposeConsents");
|
|
51
|
+
jni::local_ref<jni::JArrayClass<JPurposeConsent>> purposeConsents = this->getFieldValue(fieldPurposeConsents);
|
|
52
|
+
static const auto fieldPermissions = clazz->getField<jni::JArrayClass<JPermissionConsent>>("permissions");
|
|
53
|
+
jni::local_ref<jni::JArrayClass<JPermissionConsent>> permissions = this->getFieldValue(fieldPermissions);
|
|
54
|
+
static const auto fieldIsTestMode = clazz->getField<jboolean>("isTestMode");
|
|
55
|
+
jboolean isTestMode = this->getFieldValue(fieldIsTestMode);
|
|
56
|
+
static const auto fieldAdId = clazz->getField<jni::JString>("adId");
|
|
57
|
+
jni::local_ref<jni::JString> adId = this->getFieldValue(fieldAdId);
|
|
58
|
+
static const auto fieldBannerInfo = clazz->getField<jni::JString>("bannerInfo");
|
|
59
|
+
jni::local_ref<jni::JString> bannerInfo = this->getFieldValue(fieldBannerInfo);
|
|
60
|
+
static const auto fieldSdkVersion = clazz->getField<jni::JString>("sdkVersion");
|
|
61
|
+
jni::local_ref<jni::JString> sdkVersion = this->getFieldValue(fieldSdkVersion);
|
|
62
|
+
static const auto fieldPlatform = clazz->getField<jni::JString>("platform");
|
|
63
|
+
jni::local_ref<jni::JString> platform = this->getFieldValue(fieldPlatform);
|
|
64
|
+
return PostConsentsRequest(
|
|
65
|
+
uuid->toStdString(),
|
|
66
|
+
appUUID->toStdString(),
|
|
67
|
+
device->toStdString(),
|
|
68
|
+
static_cast<bool>(implicitConsent),
|
|
69
|
+
version,
|
|
70
|
+
[&]() {
|
|
71
|
+
size_t __size = purposeConsents->size();
|
|
72
|
+
std::vector<PurposeConsent> __vector;
|
|
73
|
+
__vector.reserve(__size);
|
|
74
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
75
|
+
auto __element = purposeConsents->getElement(__i);
|
|
76
|
+
__vector.push_back(__element->toCpp());
|
|
77
|
+
}
|
|
78
|
+
return __vector;
|
|
79
|
+
}(),
|
|
80
|
+
[&]() {
|
|
81
|
+
size_t __size = permissions->size();
|
|
82
|
+
std::vector<PermissionConsent> __vector;
|
|
83
|
+
__vector.reserve(__size);
|
|
84
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
85
|
+
auto __element = permissions->getElement(__i);
|
|
86
|
+
__vector.push_back(__element->toCpp());
|
|
87
|
+
}
|
|
88
|
+
return __vector;
|
|
89
|
+
}(),
|
|
90
|
+
static_cast<bool>(isTestMode),
|
|
91
|
+
adId->toStdString(),
|
|
92
|
+
bannerInfo->toStdString(),
|
|
93
|
+
sdkVersion != nullptr ? std::make_optional(sdkVersion->toStdString()) : std::nullopt,
|
|
94
|
+
platform != nullptr ? std::make_optional(platform->toStdString()) : std::nullopt
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
public:
|
|
99
|
+
/**
|
|
100
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
101
|
+
*/
|
|
102
|
+
[[maybe_unused]]
|
|
103
|
+
static jni::local_ref<JPostConsentsRequest::javaobject> fromCpp(const PostConsentsRequest& value) {
|
|
104
|
+
return newInstance(
|
|
105
|
+
jni::make_jstring(value.uuid),
|
|
106
|
+
jni::make_jstring(value.appUUID),
|
|
107
|
+
jni::make_jstring(value.device),
|
|
108
|
+
value.implicitConsent,
|
|
109
|
+
value.version,
|
|
110
|
+
[&]() {
|
|
111
|
+
size_t __size = value.purposeConsents.size();
|
|
112
|
+
jni::local_ref<jni::JArrayClass<JPurposeConsent>> __array = jni::JArrayClass<JPurposeConsent>::newArray(__size);
|
|
113
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
114
|
+
const auto& __element = value.purposeConsents[__i];
|
|
115
|
+
__array->setElement(__i, *JPurposeConsent::fromCpp(__element));
|
|
116
|
+
}
|
|
117
|
+
return __array;
|
|
118
|
+
}(),
|
|
119
|
+
[&]() {
|
|
120
|
+
size_t __size = value.permissions.size();
|
|
121
|
+
jni::local_ref<jni::JArrayClass<JPermissionConsent>> __array = jni::JArrayClass<JPermissionConsent>::newArray(__size);
|
|
122
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
123
|
+
const auto& __element = value.permissions[__i];
|
|
124
|
+
__array->setElement(__i, *JPermissionConsent::fromCpp(__element));
|
|
125
|
+
}
|
|
126
|
+
return __array;
|
|
127
|
+
}(),
|
|
128
|
+
value.isTestMode,
|
|
129
|
+
jni::make_jstring(value.adId),
|
|
130
|
+
jni::make_jstring(value.bannerInfo),
|
|
131
|
+
value.sdkVersion.has_value() ? jni::make_jstring(value.sdkVersion.value()) : nullptr,
|
|
132
|
+
value.platform.has_value() ? jni::make_jstring(value.platform.value()) : nullptr
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
} // namespace margelo::nitro::securiticonsentsdk
|