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,78 @@
|
|
|
1
|
+
#
|
|
2
|
+
# NitroSecuritiConsentSdk+autolinking.cmake
|
|
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
|
+
# This is a CMake file that adds all files generated by Nitrogen
|
|
9
|
+
# to the current CMake project.
|
|
10
|
+
#
|
|
11
|
+
# To use it, add this to your CMakeLists.txt:
|
|
12
|
+
# ```cmake
|
|
13
|
+
# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/NitroSecuritiConsentSdk+autolinking.cmake)
|
|
14
|
+
# ```
|
|
15
|
+
|
|
16
|
+
# Add all headers that were generated by Nitrogen
|
|
17
|
+
include_directories(
|
|
18
|
+
"../nitrogen/generated/shared/c++"
|
|
19
|
+
"../nitrogen/generated/android/c++"
|
|
20
|
+
"../nitrogen/generated/android/"
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
# Add all .cpp sources that were generated by Nitrogen
|
|
24
|
+
target_sources(
|
|
25
|
+
# CMake project name (Android C++ library name)
|
|
26
|
+
NitroSecuritiConsentSdk PRIVATE
|
|
27
|
+
# Autolinking Setup
|
|
28
|
+
../nitrogen/generated/android/NitroSecuritiConsentSdkOnLoad.cpp
|
|
29
|
+
# Shared Nitrogen C++ sources
|
|
30
|
+
../nitrogen/generated/shared/c++/HybridConsentSDKSpec.cpp
|
|
31
|
+
# Android-specific Nitrogen C++ sources
|
|
32
|
+
../nitrogen/generated/android/c++/JHybridConsentSDKSpec.cpp
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
# Define a flag to check if we are building properly
|
|
36
|
+
add_definitions(-DBUILDING_NITROSECURITICONSENTSDK_WITH_GENERATED_CMAKE_PROJECT)
|
|
37
|
+
|
|
38
|
+
# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake
|
|
39
|
+
# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake
|
|
40
|
+
target_compile_definitions(
|
|
41
|
+
NitroSecuritiConsentSdk PRIVATE
|
|
42
|
+
-DFOLLY_NO_CONFIG=1
|
|
43
|
+
-DFOLLY_HAVE_CLOCK_GETTIME=1
|
|
44
|
+
-DFOLLY_USE_LIBCPP=1
|
|
45
|
+
-DFOLLY_CFG_NO_COROUTINES=1
|
|
46
|
+
-DFOLLY_MOBILE=1
|
|
47
|
+
-DFOLLY_HAVE_RECVMMSG=1
|
|
48
|
+
-DFOLLY_HAVE_PTHREAD=1
|
|
49
|
+
# Once we target android-23 above, we can comment
|
|
50
|
+
# the following line. NDK uses GNU style stderror_r() after API 23.
|
|
51
|
+
-DFOLLY_HAVE_XSI_STRERROR_R=1
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
# Add all libraries required by the generated specs
|
|
55
|
+
find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++
|
|
56
|
+
find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule)
|
|
57
|
+
find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library
|
|
58
|
+
|
|
59
|
+
# Link all libraries together
|
|
60
|
+
target_link_libraries(
|
|
61
|
+
NitroSecuritiConsentSdk
|
|
62
|
+
fbjni::fbjni # <-- Facebook C++ JNI helpers
|
|
63
|
+
ReactAndroid::jsi # <-- RN: JSI
|
|
64
|
+
react-native-nitro-modules::NitroModules # <-- NitroModules Core :)
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
# Link react-native (different prefab between RN 0.75 and RN 0.76)
|
|
68
|
+
if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
|
|
69
|
+
target_link_libraries(
|
|
70
|
+
NitroSecuritiConsentSdk
|
|
71
|
+
ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab
|
|
72
|
+
)
|
|
73
|
+
else()
|
|
74
|
+
target_link_libraries(
|
|
75
|
+
NitroSecuritiConsentSdk
|
|
76
|
+
ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
|
|
77
|
+
)
|
|
78
|
+
endif()
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroSecuritiConsentSdk+autolinking.gradle
|
|
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
|
+
/// This is a Gradle file that adds all files generated by Nitrogen
|
|
9
|
+
/// to the current Gradle project.
|
|
10
|
+
///
|
|
11
|
+
/// To use it, add this to your build.gradle:
|
|
12
|
+
/// ```gradle
|
|
13
|
+
/// apply from: '../nitrogen/generated/android/NitroSecuritiConsentSdk+autolinking.gradle'
|
|
14
|
+
/// ```
|
|
15
|
+
|
|
16
|
+
logger.warn("[NitroModules] 🔥 NitroSecuritiConsentSdk is boosted by nitro!")
|
|
17
|
+
|
|
18
|
+
android {
|
|
19
|
+
sourceSets {
|
|
20
|
+
main {
|
|
21
|
+
java.srcDirs += [
|
|
22
|
+
// Nitrogen files
|
|
23
|
+
"${project.projectDir}/../nitrogen/generated/android/kotlin"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroSecuritiConsentSdkOnLoad.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
|
+
#ifndef BUILDING_NITROSECURITICONSENTSDK_WITH_GENERATED_CMAKE_PROJECT
|
|
9
|
+
#error NitroSecuritiConsentSdkOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this?
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
#include "NitroSecuritiConsentSdkOnLoad.hpp"
|
|
13
|
+
|
|
14
|
+
#include <jni.h>
|
|
15
|
+
#include <fbjni/fbjni.h>
|
|
16
|
+
#include <NitroModules/HybridObjectRegistry.hpp>
|
|
17
|
+
|
|
18
|
+
#include "JHybridConsentSDKSpec.hpp"
|
|
19
|
+
#include "JFunc_void_bool.hpp"
|
|
20
|
+
#include <NitroModules/JNISharedPtr.hpp>
|
|
21
|
+
#include <NitroModules/DefaultConstructableObject.hpp>
|
|
22
|
+
|
|
23
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
24
|
+
|
|
25
|
+
int initialize(JavaVM* vm) {
|
|
26
|
+
using namespace margelo::nitro;
|
|
27
|
+
using namespace margelo::nitro::securiticonsentsdk;
|
|
28
|
+
using namespace facebook;
|
|
29
|
+
|
|
30
|
+
return facebook::jni::initialize(vm, [] {
|
|
31
|
+
// Register native JNI methods
|
|
32
|
+
margelo::nitro::securiticonsentsdk::JHybridConsentSDKSpec::registerNatives();
|
|
33
|
+
margelo::nitro::securiticonsentsdk::JFunc_void_bool_cxx::registerNatives();
|
|
34
|
+
|
|
35
|
+
// Register Nitro Hybrid Objects
|
|
36
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
37
|
+
"ConsentSDK",
|
|
38
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
39
|
+
static DefaultConstructableObject<JHybridConsentSDKSpec::javaobject> object("com/margelo/nitro/securiticonsentsdk/HybridConsentSDK");
|
|
40
|
+
auto instance = object.create();
|
|
41
|
+
auto globalRef = jni::make_global(instance);
|
|
42
|
+
return JNISharedPtr::make_shared_from_jni<JHybridConsentSDKSpec>(globalRef);
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
} // namespace margelo::nitro::securiticonsentsdk
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroSecuritiConsentSdkOnLoad.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
|
+
#include <jni.h>
|
|
9
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
10
|
+
|
|
11
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Initializes the native (C++) part of NitroSecuritiConsentSdk, and autolinks all Hybrid Objects.
|
|
15
|
+
* Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`).
|
|
16
|
+
* Example:
|
|
17
|
+
* ```cpp (cpp-adapter.cpp)
|
|
18
|
+
* JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
|
|
19
|
+
* return margelo::nitro::securiticonsentsdk::initialize(vm);
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
int initialize(JavaVM* vm);
|
|
24
|
+
|
|
25
|
+
} // namespace margelo::nitro::securiticonsentsdk
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JAppPermission.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 "AppPermission.hpp"
|
|
12
|
+
|
|
13
|
+
#include <optional>
|
|
14
|
+
#include <string>
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
17
|
+
|
|
18
|
+
using namespace facebook;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "AppPermission" and the the Kotlin data class "AppPermission".
|
|
22
|
+
*/
|
|
23
|
+
struct JAppPermission final: public jni::JavaClass<JAppPermission> {
|
|
24
|
+
public:
|
|
25
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/securiticonsentsdk/AppPermission;";
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
/**
|
|
29
|
+
* Convert this Java/Kotlin-based struct to the C++ struct AppPermission by copying all values to C++.
|
|
30
|
+
*/
|
|
31
|
+
[[maybe_unused]]
|
|
32
|
+
[[nodiscard]]
|
|
33
|
+
AppPermission toCpp() const {
|
|
34
|
+
static const auto clazz = javaClassStatic();
|
|
35
|
+
static const auto fieldId = clazz->getField<jni::JDouble>("id");
|
|
36
|
+
jni::local_ref<jni::JDouble> id = this->getFieldValue(fieldId);
|
|
37
|
+
static const auto fieldName = clazz->getField<jni::JString>("name");
|
|
38
|
+
jni::local_ref<jni::JString> name = this->getFieldValue(fieldName);
|
|
39
|
+
static const auto fieldPermissionId = clazz->getField<jni::JString>("permissionId");
|
|
40
|
+
jni::local_ref<jni::JString> permissionId = this->getFieldValue(fieldPermissionId);
|
|
41
|
+
static const auto fieldDescription = clazz->getField<jni::JString>("description");
|
|
42
|
+
jni::local_ref<jni::JString> description = this->getFieldValue(fieldDescription);
|
|
43
|
+
static const auto fieldGroup = clazz->getField<jni::JString>("group");
|
|
44
|
+
jni::local_ref<jni::JString> group = this->getFieldValue(fieldGroup);
|
|
45
|
+
static const auto fieldGroupId = clazz->getField<jni::JDouble>("groupId");
|
|
46
|
+
jni::local_ref<jni::JDouble> groupId = this->getFieldValue(fieldGroupId);
|
|
47
|
+
static const auto fieldConsentStatus = clazz->getField<jni::JString>("consentStatus");
|
|
48
|
+
jni::local_ref<jni::JString> consentStatus = this->getFieldValue(fieldConsentStatus);
|
|
49
|
+
static const auto fieldNameMap = clazz->getField<jni::JString>("nameMap");
|
|
50
|
+
jni::local_ref<jni::JString> nameMap = this->getFieldValue(fieldNameMap);
|
|
51
|
+
static const auto fieldIsSettingsPromptEnabled = clazz->getField<jni::JBoolean>("isSettingsPromptEnabled");
|
|
52
|
+
jni::local_ref<jni::JBoolean> isSettingsPromptEnabled = this->getFieldValue(fieldIsSettingsPromptEnabled);
|
|
53
|
+
return AppPermission(
|
|
54
|
+
id != nullptr ? std::make_optional(id->value()) : std::nullopt,
|
|
55
|
+
name != nullptr ? std::make_optional(name->toStdString()) : std::nullopt,
|
|
56
|
+
permissionId != nullptr ? std::make_optional(permissionId->toStdString()) : std::nullopt,
|
|
57
|
+
description != nullptr ? std::make_optional(description->toStdString()) : std::nullopt,
|
|
58
|
+
group != nullptr ? std::make_optional(group->toStdString()) : std::nullopt,
|
|
59
|
+
groupId != nullptr ? std::make_optional(groupId->value()) : std::nullopt,
|
|
60
|
+
consentStatus != nullptr ? std::make_optional(consentStatus->toStdString()) : std::nullopt,
|
|
61
|
+
nameMap != nullptr ? std::make_optional(nameMap->toStdString()) : std::nullopt,
|
|
62
|
+
isSettingsPromptEnabled != nullptr ? std::make_optional(static_cast<bool>(isSettingsPromptEnabled->value())) : std::nullopt
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public:
|
|
67
|
+
/**
|
|
68
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
69
|
+
*/
|
|
70
|
+
[[maybe_unused]]
|
|
71
|
+
static jni::local_ref<JAppPermission::javaobject> fromCpp(const AppPermission& value) {
|
|
72
|
+
return newInstance(
|
|
73
|
+
value.id.has_value() ? jni::JDouble::valueOf(value.id.value()) : nullptr,
|
|
74
|
+
value.name.has_value() ? jni::make_jstring(value.name.value()) : nullptr,
|
|
75
|
+
value.permissionId.has_value() ? jni::make_jstring(value.permissionId.value()) : nullptr,
|
|
76
|
+
value.description.has_value() ? jni::make_jstring(value.description.value()) : nullptr,
|
|
77
|
+
value.group.has_value() ? jni::make_jstring(value.group.value()) : nullptr,
|
|
78
|
+
value.groupId.has_value() ? jni::JDouble::valueOf(value.groupId.value()) : nullptr,
|
|
79
|
+
value.consentStatus.has_value() ? jni::make_jstring(value.consentStatus.value()) : nullptr,
|
|
80
|
+
value.nameMap.has_value() ? jni::make_jstring(value.nameMap.value()) : nullptr,
|
|
81
|
+
value.isSettingsPromptEnabled.has_value() ? jni::JBoolean::valueOf(value.isSettingsPromptEnabled.value()) : nullptr
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
} // namespace margelo::nitro::securiticonsentsdk
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JBannerConfig.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 "BannerConfig.hpp"
|
|
12
|
+
|
|
13
|
+
#include "CustomColors.hpp"
|
|
14
|
+
#include "JCustomColors.hpp"
|
|
15
|
+
#include <optional>
|
|
16
|
+
#include <string>
|
|
17
|
+
#include <unordered_map>
|
|
18
|
+
|
|
19
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
20
|
+
|
|
21
|
+
using namespace facebook;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The C++ JNI bridge between the C++ struct "BannerConfig" and the the Kotlin data class "BannerConfig".
|
|
25
|
+
*/
|
|
26
|
+
struct JBannerConfig final: public jni::JavaClass<JBannerConfig> {
|
|
27
|
+
public:
|
|
28
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/securiticonsentsdk/BannerConfig;";
|
|
29
|
+
|
|
30
|
+
public:
|
|
31
|
+
/**
|
|
32
|
+
* Convert this Java/Kotlin-based struct to the C++ struct BannerConfig by copying all values to C++.
|
|
33
|
+
*/
|
|
34
|
+
[[maybe_unused]]
|
|
35
|
+
[[nodiscard]]
|
|
36
|
+
BannerConfig toCpp() const {
|
|
37
|
+
static const auto clazz = javaClassStatic();
|
|
38
|
+
static const auto fieldHideCloseButton = clazz->getField<jni::JBoolean>("hideCloseButton");
|
|
39
|
+
jni::local_ref<jni::JBoolean> hideCloseButton = this->getFieldValue(fieldHideCloseButton);
|
|
40
|
+
static const auto fieldHideAcceptButton = clazz->getField<jni::JBoolean>("hideAcceptButton");
|
|
41
|
+
jni::local_ref<jni::JBoolean> hideAcceptButton = this->getFieldValue(fieldHideAcceptButton);
|
|
42
|
+
static const auto fieldEmbedDSRPortalLink = clazz->getField<jni::JBoolean>("embedDSRPortalLink");
|
|
43
|
+
jni::local_ref<jni::JBoolean> embedDSRPortalLink = this->getFieldValue(fieldEmbedDSRPortalLink);
|
|
44
|
+
static const auto fieldRecordConsentUponAppStart = clazz->getField<jni::JBoolean>("recordConsentUponAppStart");
|
|
45
|
+
jni::local_ref<jni::JBoolean> recordConsentUponAppStart = this->getFieldValue(fieldRecordConsentUponAppStart);
|
|
46
|
+
static const auto fieldHideToggleForEssentialCategories = clazz->getField<jni::JBoolean>("hideToggleForEssentialCategories");
|
|
47
|
+
jni::local_ref<jni::JBoolean> hideToggleForEssentialCategories = this->getFieldValue(fieldHideToggleForEssentialCategories);
|
|
48
|
+
static const auto fieldName = clazz->getField<jni::JString>("name");
|
|
49
|
+
jni::local_ref<jni::JString> name = this->getFieldValue(fieldName);
|
|
50
|
+
static const auto fieldDsrPortalLink = clazz->getField<jni::JString>("dsrPortalLink");
|
|
51
|
+
jni::local_ref<jni::JString> dsrPortalLink = this->getFieldValue(fieldDsrPortalLink);
|
|
52
|
+
static const auto fieldComplianceType = clazz->getField<jni::JString>("complianceType");
|
|
53
|
+
jni::local_ref<jni::JString> complianceType = this->getFieldValue(fieldComplianceType);
|
|
54
|
+
static const auto fieldBannerReappearanceTime = clazz->getField<jni::JString>("bannerReappearanceTime");
|
|
55
|
+
jni::local_ref<jni::JString> bannerReappearanceTime = this->getFieldValue(fieldBannerReappearanceTime);
|
|
56
|
+
static const auto fieldPrivacyNoticeLink = clazz->getField<jni::JString>("privacyNoticeLink");
|
|
57
|
+
jni::local_ref<jni::JString> privacyNoticeLink = this->getFieldValue(fieldPrivacyNoticeLink);
|
|
58
|
+
static const auto fieldAccept = clazz->getField<jni::JString>("accept");
|
|
59
|
+
jni::local_ref<jni::JString> accept = this->getFieldValue(fieldAccept);
|
|
60
|
+
static const auto fieldReject = clazz->getField<jni::JString>("reject");
|
|
61
|
+
jni::local_ref<jni::JString> reject = this->getFieldValue(fieldReject);
|
|
62
|
+
static const auto fieldBannerText = clazz->getField<jni::JString>("bannerText");
|
|
63
|
+
jni::local_ref<jni::JString> bannerText = this->getFieldValue(fieldBannerText);
|
|
64
|
+
static const auto fieldBannerHeading = clazz->getField<jni::JString>("bannerHeading");
|
|
65
|
+
jni::local_ref<jni::JString> bannerHeading = this->getFieldValue(fieldBannerHeading);
|
|
66
|
+
static const auto fieldSdkTabHeading = clazz->getField<jni::JString>("sdkTabHeading");
|
|
67
|
+
jni::local_ref<jni::JString> sdkTabHeading = this->getFieldValue(fieldSdkTabHeading);
|
|
68
|
+
static const auto fieldPrivacyNoticeText = clazz->getField<jni::JString>("privacyNoticeText");
|
|
69
|
+
jni::local_ref<jni::JString> privacyNoticeText = this->getFieldValue(fieldPrivacyNoticeText);
|
|
70
|
+
static const auto fieldPreferenceCenterLink = clazz->getField<jni::JString>("preferenceCenterLink");
|
|
71
|
+
jni::local_ref<jni::JString> preferenceCenterLink = this->getFieldValue(fieldPreferenceCenterLink);
|
|
72
|
+
static const auto fieldPermissionsTabHeading = clazz->getField<jni::JString>("permissionsTabHeading");
|
|
73
|
+
jni::local_ref<jni::JString> permissionsTabHeading = this->getFieldValue(fieldPermissionsTabHeading);
|
|
74
|
+
static const auto fieldPermissionsTabGuidance = clazz->getField<jni::JString>("permissionsTabGuidance");
|
|
75
|
+
jni::local_ref<jni::JString> permissionsTabGuidance = this->getFieldValue(fieldPermissionsTabGuidance);
|
|
76
|
+
static const auto fieldPreferenceCenterHeading = clazz->getField<jni::JString>("preferenceCenterHeading");
|
|
77
|
+
jni::local_ref<jni::JString> preferenceCenterHeading = this->getFieldValue(fieldPreferenceCenterHeading);
|
|
78
|
+
static const auto fieldPreferenceCenterGuidance = clazz->getField<jni::JString>("preferenceCenterGuidance");
|
|
79
|
+
jni::local_ref<jni::JString> preferenceCenterGuidance = this->getFieldValue(fieldPreferenceCenterGuidance);
|
|
80
|
+
static const auto fieldPermissionsTabDescription = clazz->getField<jni::JString>("permissionsTabDescription");
|
|
81
|
+
jni::local_ref<jni::JString> permissionsTabDescription = this->getFieldValue(fieldPermissionsTabDescription);
|
|
82
|
+
static const auto fieldPreferenceCenterDescription = clazz->getField<jni::JString>("preferenceCenterDescription");
|
|
83
|
+
jni::local_ref<jni::JString> preferenceCenterDescription = this->getFieldValue(fieldPreferenceCenterDescription);
|
|
84
|
+
static const auto fieldShowPoweredBySecuritiLogo = clazz->getField<jni::JBoolean>("showPoweredBySecuritiLogo");
|
|
85
|
+
jni::local_ref<jni::JBoolean> showPoweredBySecuritiLogo = this->getFieldValue(fieldShowPoweredBySecuritiLogo);
|
|
86
|
+
static const auto fieldShowDescriptionTextWithPrefCenterToggle = clazz->getField<jni::JBoolean>("showDescriptionTextWithPrefCenterToggle");
|
|
87
|
+
jni::local_ref<jni::JBoolean> showDescriptionTextWithPrefCenterToggle = this->getFieldValue(fieldShowDescriptionTextWithPrefCenterToggle);
|
|
88
|
+
static const auto fieldPaletteTheme = clazz->getField<jni::JDouble>("paletteTheme");
|
|
89
|
+
jni::local_ref<jni::JDouble> paletteTheme = this->getFieldValue(fieldPaletteTheme);
|
|
90
|
+
static const auto fieldBannerPosition = clazz->getField<jni::JString>("bannerPosition");
|
|
91
|
+
jni::local_ref<jni::JString> bannerPosition = this->getFieldValue(fieldBannerPosition);
|
|
92
|
+
static const auto fieldButtonShape = clazz->getField<jni::JString>("buttonShape");
|
|
93
|
+
jni::local_ref<jni::JString> buttonShape = this->getFieldValue(fieldButtonShape);
|
|
94
|
+
static const auto fieldCompanyLogo = clazz->getField<jni::JString>("companyLogo");
|
|
95
|
+
jni::local_ref<jni::JString> companyLogo = this->getFieldValue(fieldCompanyLogo);
|
|
96
|
+
static const auto fieldCustomPaletteTheme = clazz->getField<JCustomColors>("customPaletteTheme");
|
|
97
|
+
jni::local_ref<JCustomColors> customPaletteTheme = this->getFieldValue(fieldCustomPaletteTheme);
|
|
98
|
+
static const auto fieldShouldShowSettingsPrompt = clazz->getField<jni::JBoolean>("shouldShowSettingsPrompt");
|
|
99
|
+
jni::local_ref<jni::JBoolean> shouldShowSettingsPrompt = this->getFieldValue(fieldShouldShowSettingsPrompt);
|
|
100
|
+
static const auto fieldTranslations = clazz->getField<jni::JMap<jni::JString, jni::JString>>("translations");
|
|
101
|
+
jni::local_ref<jni::JMap<jni::JString, jni::JString>> translations = this->getFieldValue(fieldTranslations);
|
|
102
|
+
return BannerConfig(
|
|
103
|
+
hideCloseButton != nullptr ? std::make_optional(static_cast<bool>(hideCloseButton->value())) : std::nullopt,
|
|
104
|
+
hideAcceptButton != nullptr ? std::make_optional(static_cast<bool>(hideAcceptButton->value())) : std::nullopt,
|
|
105
|
+
embedDSRPortalLink != nullptr ? std::make_optional(static_cast<bool>(embedDSRPortalLink->value())) : std::nullopt,
|
|
106
|
+
recordConsentUponAppStart != nullptr ? std::make_optional(static_cast<bool>(recordConsentUponAppStart->value())) : std::nullopt,
|
|
107
|
+
hideToggleForEssentialCategories != nullptr ? std::make_optional(static_cast<bool>(hideToggleForEssentialCategories->value())) : std::nullopt,
|
|
108
|
+
name != nullptr ? std::make_optional(name->toStdString()) : std::nullopt,
|
|
109
|
+
dsrPortalLink != nullptr ? std::make_optional(dsrPortalLink->toStdString()) : std::nullopt,
|
|
110
|
+
complianceType != nullptr ? std::make_optional(complianceType->toStdString()) : std::nullopt,
|
|
111
|
+
bannerReappearanceTime != nullptr ? std::make_optional(bannerReappearanceTime->toStdString()) : std::nullopt,
|
|
112
|
+
privacyNoticeLink != nullptr ? std::make_optional(privacyNoticeLink->toStdString()) : std::nullopt,
|
|
113
|
+
accept != nullptr ? std::make_optional(accept->toStdString()) : std::nullopt,
|
|
114
|
+
reject != nullptr ? std::make_optional(reject->toStdString()) : std::nullopt,
|
|
115
|
+
bannerText != nullptr ? std::make_optional(bannerText->toStdString()) : std::nullopt,
|
|
116
|
+
bannerHeading != nullptr ? std::make_optional(bannerHeading->toStdString()) : std::nullopt,
|
|
117
|
+
sdkTabHeading != nullptr ? std::make_optional(sdkTabHeading->toStdString()) : std::nullopt,
|
|
118
|
+
privacyNoticeText != nullptr ? std::make_optional(privacyNoticeText->toStdString()) : std::nullopt,
|
|
119
|
+
preferenceCenterLink != nullptr ? std::make_optional(preferenceCenterLink->toStdString()) : std::nullopt,
|
|
120
|
+
permissionsTabHeading != nullptr ? std::make_optional(permissionsTabHeading->toStdString()) : std::nullopt,
|
|
121
|
+
permissionsTabGuidance != nullptr ? std::make_optional(permissionsTabGuidance->toStdString()) : std::nullopt,
|
|
122
|
+
preferenceCenterHeading != nullptr ? std::make_optional(preferenceCenterHeading->toStdString()) : std::nullopt,
|
|
123
|
+
preferenceCenterGuidance != nullptr ? std::make_optional(preferenceCenterGuidance->toStdString()) : std::nullopt,
|
|
124
|
+
permissionsTabDescription != nullptr ? std::make_optional(permissionsTabDescription->toStdString()) : std::nullopt,
|
|
125
|
+
preferenceCenterDescription != nullptr ? std::make_optional(preferenceCenterDescription->toStdString()) : std::nullopt,
|
|
126
|
+
showPoweredBySecuritiLogo != nullptr ? std::make_optional(static_cast<bool>(showPoweredBySecuritiLogo->value())) : std::nullopt,
|
|
127
|
+
showDescriptionTextWithPrefCenterToggle != nullptr ? std::make_optional(static_cast<bool>(showDescriptionTextWithPrefCenterToggle->value())) : std::nullopt,
|
|
128
|
+
paletteTheme != nullptr ? std::make_optional(paletteTheme->value()) : std::nullopt,
|
|
129
|
+
bannerPosition != nullptr ? std::make_optional(bannerPosition->toStdString()) : std::nullopt,
|
|
130
|
+
buttonShape != nullptr ? std::make_optional(buttonShape->toStdString()) : std::nullopt,
|
|
131
|
+
companyLogo != nullptr ? std::make_optional(companyLogo->toStdString()) : std::nullopt,
|
|
132
|
+
customPaletteTheme != nullptr ? std::make_optional(customPaletteTheme->toCpp()) : std::nullopt,
|
|
133
|
+
shouldShowSettingsPrompt != nullptr ? std::make_optional(static_cast<bool>(shouldShowSettingsPrompt->value())) : std::nullopt,
|
|
134
|
+
translations != nullptr ? std::make_optional([&]() {
|
|
135
|
+
std::unordered_map<std::string, std::string> __map;
|
|
136
|
+
__map.reserve(translations->size());
|
|
137
|
+
for (const auto& __entry : *translations) {
|
|
138
|
+
__map.emplace(__entry.first->toStdString(), __entry.second->toStdString());
|
|
139
|
+
}
|
|
140
|
+
return __map;
|
|
141
|
+
}()) : std::nullopt
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
public:
|
|
146
|
+
/**
|
|
147
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
148
|
+
*/
|
|
149
|
+
[[maybe_unused]]
|
|
150
|
+
static jni::local_ref<JBannerConfig::javaobject> fromCpp(const BannerConfig& value) {
|
|
151
|
+
return newInstance(
|
|
152
|
+
value.hideCloseButton.has_value() ? jni::JBoolean::valueOf(value.hideCloseButton.value()) : nullptr,
|
|
153
|
+
value.hideAcceptButton.has_value() ? jni::JBoolean::valueOf(value.hideAcceptButton.value()) : nullptr,
|
|
154
|
+
value.embedDSRPortalLink.has_value() ? jni::JBoolean::valueOf(value.embedDSRPortalLink.value()) : nullptr,
|
|
155
|
+
value.recordConsentUponAppStart.has_value() ? jni::JBoolean::valueOf(value.recordConsentUponAppStart.value()) : nullptr,
|
|
156
|
+
value.hideToggleForEssentialCategories.has_value() ? jni::JBoolean::valueOf(value.hideToggleForEssentialCategories.value()) : nullptr,
|
|
157
|
+
value.name.has_value() ? jni::make_jstring(value.name.value()) : nullptr,
|
|
158
|
+
value.dsrPortalLink.has_value() ? jni::make_jstring(value.dsrPortalLink.value()) : nullptr,
|
|
159
|
+
value.complianceType.has_value() ? jni::make_jstring(value.complianceType.value()) : nullptr,
|
|
160
|
+
value.bannerReappearanceTime.has_value() ? jni::make_jstring(value.bannerReappearanceTime.value()) : nullptr,
|
|
161
|
+
value.privacyNoticeLink.has_value() ? jni::make_jstring(value.privacyNoticeLink.value()) : nullptr,
|
|
162
|
+
value.accept.has_value() ? jni::make_jstring(value.accept.value()) : nullptr,
|
|
163
|
+
value.reject.has_value() ? jni::make_jstring(value.reject.value()) : nullptr,
|
|
164
|
+
value.bannerText.has_value() ? jni::make_jstring(value.bannerText.value()) : nullptr,
|
|
165
|
+
value.bannerHeading.has_value() ? jni::make_jstring(value.bannerHeading.value()) : nullptr,
|
|
166
|
+
value.sdkTabHeading.has_value() ? jni::make_jstring(value.sdkTabHeading.value()) : nullptr,
|
|
167
|
+
value.privacyNoticeText.has_value() ? jni::make_jstring(value.privacyNoticeText.value()) : nullptr,
|
|
168
|
+
value.preferenceCenterLink.has_value() ? jni::make_jstring(value.preferenceCenterLink.value()) : nullptr,
|
|
169
|
+
value.permissionsTabHeading.has_value() ? jni::make_jstring(value.permissionsTabHeading.value()) : nullptr,
|
|
170
|
+
value.permissionsTabGuidance.has_value() ? jni::make_jstring(value.permissionsTabGuidance.value()) : nullptr,
|
|
171
|
+
value.preferenceCenterHeading.has_value() ? jni::make_jstring(value.preferenceCenterHeading.value()) : nullptr,
|
|
172
|
+
value.preferenceCenterGuidance.has_value() ? jni::make_jstring(value.preferenceCenterGuidance.value()) : nullptr,
|
|
173
|
+
value.permissionsTabDescription.has_value() ? jni::make_jstring(value.permissionsTabDescription.value()) : nullptr,
|
|
174
|
+
value.preferenceCenterDescription.has_value() ? jni::make_jstring(value.preferenceCenterDescription.value()) : nullptr,
|
|
175
|
+
value.showPoweredBySecuritiLogo.has_value() ? jni::JBoolean::valueOf(value.showPoweredBySecuritiLogo.value()) : nullptr,
|
|
176
|
+
value.showDescriptionTextWithPrefCenterToggle.has_value() ? jni::JBoolean::valueOf(value.showDescriptionTextWithPrefCenterToggle.value()) : nullptr,
|
|
177
|
+
value.paletteTheme.has_value() ? jni::JDouble::valueOf(value.paletteTheme.value()) : nullptr,
|
|
178
|
+
value.bannerPosition.has_value() ? jni::make_jstring(value.bannerPosition.value()) : nullptr,
|
|
179
|
+
value.buttonShape.has_value() ? jni::make_jstring(value.buttonShape.value()) : nullptr,
|
|
180
|
+
value.companyLogo.has_value() ? jni::make_jstring(value.companyLogo.value()) : nullptr,
|
|
181
|
+
value.customPaletteTheme.has_value() ? JCustomColors::fromCpp(value.customPaletteTheme.value()) : nullptr,
|
|
182
|
+
value.shouldShowSettingsPrompt.has_value() ? jni::JBoolean::valueOf(value.shouldShowSettingsPrompt.value()) : nullptr,
|
|
183
|
+
value.translations.has_value() ? [&]() -> jni::local_ref<jni::JMap<jni::JString, jni::JString>> {
|
|
184
|
+
auto __map = jni::JHashMap<jni::JString, jni::JString>::create(value.translations.value().size());
|
|
185
|
+
for (const auto& __entry : value.translations.value()) {
|
|
186
|
+
__map->put(jni::make_jstring(__entry.first), jni::make_jstring(__entry.second));
|
|
187
|
+
}
|
|
188
|
+
return __map;
|
|
189
|
+
}() : nullptr
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
} // namespace margelo::nitro::securiticonsentsdk
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JCmpSDKOptions.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 "CmpSDKOptions.hpp"
|
|
12
|
+
|
|
13
|
+
#include <optional>
|
|
14
|
+
#include <string>
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
17
|
+
|
|
18
|
+
using namespace facebook;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "CmpSDKOptions" and the the Kotlin data class "CmpSDKOptions".
|
|
22
|
+
*/
|
|
23
|
+
struct JCmpSDKOptions final: public jni::JavaClass<JCmpSDKOptions> {
|
|
24
|
+
public:
|
|
25
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/securiticonsentsdk/CmpSDKOptions;";
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
/**
|
|
29
|
+
* Convert this Java/Kotlin-based struct to the C++ struct CmpSDKOptions by copying all values to C++.
|
|
30
|
+
*/
|
|
31
|
+
[[maybe_unused]]
|
|
32
|
+
[[nodiscard]]
|
|
33
|
+
CmpSDKOptions toCpp() const {
|
|
34
|
+
static const auto clazz = javaClassStatic();
|
|
35
|
+
static const auto fieldAppURL = clazz->getField<jni::JString>("appURL");
|
|
36
|
+
jni::local_ref<jni::JString> appURL = this->getFieldValue(fieldAppURL);
|
|
37
|
+
static const auto fieldCdnURL = clazz->getField<jni::JString>("cdnURL");
|
|
38
|
+
jni::local_ref<jni::JString> cdnURL = this->getFieldValue(fieldCdnURL);
|
|
39
|
+
static const auto fieldTenantID = clazz->getField<jni::JString>("tenantID");
|
|
40
|
+
jni::local_ref<jni::JString> tenantID = this->getFieldValue(fieldTenantID);
|
|
41
|
+
static const auto fieldAppID = clazz->getField<jni::JString>("appID");
|
|
42
|
+
jni::local_ref<jni::JString> appID = this->getFieldValue(fieldAppID);
|
|
43
|
+
static const auto fieldTestingMode = clazz->getField<jboolean>("testingMode");
|
|
44
|
+
jboolean testingMode = this->getFieldValue(fieldTestingMode);
|
|
45
|
+
static const auto fieldLoggerLevel = clazz->getField<jni::JString>("loggerLevel");
|
|
46
|
+
jni::local_ref<jni::JString> loggerLevel = this->getFieldValue(fieldLoggerLevel);
|
|
47
|
+
static const auto fieldConsentsCheckInterval = clazz->getField<double>("consentsCheckInterval");
|
|
48
|
+
double consentsCheckInterval = this->getFieldValue(fieldConsentsCheckInterval);
|
|
49
|
+
static const auto fieldSubjectId = clazz->getField<jni::JString>("subjectId");
|
|
50
|
+
jni::local_ref<jni::JString> subjectId = this->getFieldValue(fieldSubjectId);
|
|
51
|
+
static const auto fieldLanguageCode = clazz->getField<jni::JString>("languageCode");
|
|
52
|
+
jni::local_ref<jni::JString> languageCode = this->getFieldValue(fieldLanguageCode);
|
|
53
|
+
static const auto fieldLocationCode = clazz->getField<jni::JString>("locationCode");
|
|
54
|
+
jni::local_ref<jni::JString> locationCode = this->getFieldValue(fieldLocationCode);
|
|
55
|
+
static const auto fieldMode = clazz->getField<jni::JString>("mode");
|
|
56
|
+
jni::local_ref<jni::JString> mode = this->getFieldValue(fieldMode);
|
|
57
|
+
return CmpSDKOptions(
|
|
58
|
+
appURL->toStdString(),
|
|
59
|
+
cdnURL->toStdString(),
|
|
60
|
+
tenantID->toStdString(),
|
|
61
|
+
appID->toStdString(),
|
|
62
|
+
static_cast<bool>(testingMode),
|
|
63
|
+
loggerLevel->toStdString(),
|
|
64
|
+
consentsCheckInterval,
|
|
65
|
+
subjectId != nullptr ? std::make_optional(subjectId->toStdString()) : std::nullopt,
|
|
66
|
+
languageCode != nullptr ? std::make_optional(languageCode->toStdString()) : std::nullopt,
|
|
67
|
+
locationCode != nullptr ? std::make_optional(locationCode->toStdString()) : std::nullopt,
|
|
68
|
+
mode != nullptr ? std::make_optional(mode->toStdString()) : std::nullopt
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public:
|
|
73
|
+
/**
|
|
74
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
75
|
+
*/
|
|
76
|
+
[[maybe_unused]]
|
|
77
|
+
static jni::local_ref<JCmpSDKOptions::javaobject> fromCpp(const CmpSDKOptions& value) {
|
|
78
|
+
return newInstance(
|
|
79
|
+
jni::make_jstring(value.appURL),
|
|
80
|
+
jni::make_jstring(value.cdnURL),
|
|
81
|
+
jni::make_jstring(value.tenantID),
|
|
82
|
+
jni::make_jstring(value.appID),
|
|
83
|
+
value.testingMode,
|
|
84
|
+
jni::make_jstring(value.loggerLevel),
|
|
85
|
+
value.consentsCheckInterval,
|
|
86
|
+
value.subjectId.has_value() ? jni::make_jstring(value.subjectId.value()) : nullptr,
|
|
87
|
+
value.languageCode.has_value() ? jni::make_jstring(value.languageCode.value()) : nullptr,
|
|
88
|
+
value.locationCode.has_value() ? jni::make_jstring(value.locationCode.value()) : nullptr,
|
|
89
|
+
value.mode.has_value() ? jni::make_jstring(value.mode.value()) : nullptr
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
} // namespace margelo::nitro::securiticonsentsdk
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JCustomColors.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 "CustomColors.hpp"
|
|
12
|
+
|
|
13
|
+
#include <optional>
|
|
14
|
+
#include <string>
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
17
|
+
|
|
18
|
+
using namespace facebook;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "CustomColors" and the the Kotlin data class "CustomColors".
|
|
22
|
+
*/
|
|
23
|
+
struct JCustomColors final: public jni::JavaClass<JCustomColors> {
|
|
24
|
+
public:
|
|
25
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/securiticonsentsdk/CustomColors;";
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
/**
|
|
29
|
+
* Convert this Java/Kotlin-based struct to the C++ struct CustomColors by copying all values to C++.
|
|
30
|
+
*/
|
|
31
|
+
[[maybe_unused]]
|
|
32
|
+
[[nodiscard]]
|
|
33
|
+
CustomColors toCpp() const {
|
|
34
|
+
static const auto clazz = javaClassStatic();
|
|
35
|
+
static const auto fieldButtonBackground = clazz->getField<jni::JString>("buttonBackground");
|
|
36
|
+
jni::local_ref<jni::JString> buttonBackground = this->getFieldValue(fieldButtonBackground);
|
|
37
|
+
static const auto fieldButtonText = clazz->getField<jni::JString>("buttonText");
|
|
38
|
+
jni::local_ref<jni::JString> buttonText = this->getFieldValue(fieldButtonText);
|
|
39
|
+
static const auto fieldButtonBorder = clazz->getField<jni::JString>("buttonBorder");
|
|
40
|
+
jni::local_ref<jni::JString> buttonBorder = this->getFieldValue(fieldButtonBorder);
|
|
41
|
+
static const auto fieldBannerBackground = clazz->getField<jni::JString>("bannerBackground");
|
|
42
|
+
jni::local_ref<jni::JString> bannerBackground = this->getFieldValue(fieldBannerBackground);
|
|
43
|
+
static const auto fieldBannerText = clazz->getField<jni::JString>("bannerText");
|
|
44
|
+
jni::local_ref<jni::JString> bannerText = this->getFieldValue(fieldBannerText);
|
|
45
|
+
static const auto fieldBannerLinks = clazz->getField<jni::JString>("bannerLinks");
|
|
46
|
+
jni::local_ref<jni::JString> bannerLinks = this->getFieldValue(fieldBannerLinks);
|
|
47
|
+
static const auto fieldPreferenceCenterFooterBackground = clazz->getField<jni::JString>("preferenceCenterFooterBackground");
|
|
48
|
+
jni::local_ref<jni::JString> preferenceCenterFooterBackground = this->getFieldValue(fieldPreferenceCenterFooterBackground);
|
|
49
|
+
static const auto fieldPreferenceCenterFooterSelector = clazz->getField<jni::JString>("preferenceCenterFooterSelector");
|
|
50
|
+
jni::local_ref<jni::JString> preferenceCenterFooterSelector = this->getFieldValue(fieldPreferenceCenterFooterSelector);
|
|
51
|
+
return CustomColors(
|
|
52
|
+
buttonBackground != nullptr ? std::make_optional(buttonBackground->toStdString()) : std::nullopt,
|
|
53
|
+
buttonText != nullptr ? std::make_optional(buttonText->toStdString()) : std::nullopt,
|
|
54
|
+
buttonBorder != nullptr ? std::make_optional(buttonBorder->toStdString()) : std::nullopt,
|
|
55
|
+
bannerBackground != nullptr ? std::make_optional(bannerBackground->toStdString()) : std::nullopt,
|
|
56
|
+
bannerText != nullptr ? std::make_optional(bannerText->toStdString()) : std::nullopt,
|
|
57
|
+
bannerLinks != nullptr ? std::make_optional(bannerLinks->toStdString()) : std::nullopt,
|
|
58
|
+
preferenceCenterFooterBackground != nullptr ? std::make_optional(preferenceCenterFooterBackground->toStdString()) : std::nullopt,
|
|
59
|
+
preferenceCenterFooterSelector != nullptr ? std::make_optional(preferenceCenterFooterSelector->toStdString()) : std::nullopt
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public:
|
|
64
|
+
/**
|
|
65
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
66
|
+
*/
|
|
67
|
+
[[maybe_unused]]
|
|
68
|
+
static jni::local_ref<JCustomColors::javaobject> fromCpp(const CustomColors& value) {
|
|
69
|
+
return newInstance(
|
|
70
|
+
value.buttonBackground.has_value() ? jni::make_jstring(value.buttonBackground.value()) : nullptr,
|
|
71
|
+
value.buttonText.has_value() ? jni::make_jstring(value.buttonText.value()) : nullptr,
|
|
72
|
+
value.buttonBorder.has_value() ? jni::make_jstring(value.buttonBorder.value()) : nullptr,
|
|
73
|
+
value.bannerBackground.has_value() ? jni::make_jstring(value.bannerBackground.value()) : nullptr,
|
|
74
|
+
value.bannerText.has_value() ? jni::make_jstring(value.bannerText.value()) : nullptr,
|
|
75
|
+
value.bannerLinks.has_value() ? jni::make_jstring(value.bannerLinks.value()) : nullptr,
|
|
76
|
+
value.preferenceCenterFooterBackground.has_value() ? jni::make_jstring(value.preferenceCenterFooterBackground.value()) : nullptr,
|
|
77
|
+
value.preferenceCenterFooterSelector.has_value() ? jni::make_jstring(value.preferenceCenterFooterSelector.value()) : nullptr
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
} // namespace margelo::nitro::securiticonsentsdk
|