Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 7 additions & 52 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
buildscript {
ext.safeExtGet = {prop, fallback ->
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
}
ext.safeExtGet = {prop, fallback ->
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

if (isNewArchitectureEnabled()) {
Expand All @@ -26,61 +16,26 @@ android {
versionCode 1
versionName "1.0"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
if (isNewArchitectureEnabled()) {
var appProject = rootProject.allprojects.find {it.plugins.hasPlugin('com.android.application')}
externalNativeBuild {
ndkBuild {
arguments "APP_PLATFORM=android-21",
"APP_STL=c++_shared",
"NDK_TOOLCHAIN_VERSION=clang",
"GENERATED_SRC_DIR=${appProject.buildDir}/generated/source",
"PROJECT_BUILD_DIR=${appProject.buildDir}",
"REACT_ANDROID_DIR=${appProject.rootDir}/../node_modules/react-native/ReactAndroid",
"REACT_ANDROID_BUILD_DIR=${appProject.rootDir}/../node_modules/react-native/ReactAndroid/build"
cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
cppFlags "-std=c++17"
targets "rnaps_modules"
}
}
}
}
if (isNewArchitectureEnabled()) {
externalNativeBuild {
ndkBuild {
path "src/main/jni/Android.mk"
}
}
}
packagingOptions {
// For some reason gradle only complains about the duplicated version of libreact_render libraries
// while there are more libraries copied in intermediates folder of the lib build directory, we exclude
// only the ones that make the build fail (ideally we should only include librnaps_modules but we
// are only allowed to specify exclude patterns)
exclude "**/libreact_render*.so"

}


buildTypes {
release {
minifyEnabled true
proguardFile 'proguard-rules.pro'
minifyEnabled false
consumerProguardFiles 'proguard-rules.pro'
}
}
}

repositories {
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
// Matches the RN Hello World template
// https://github.com/facebook/react-native/blob/1e8f3b11027fe0a7514b4fc97d0798d3c64bc895/local-cli/templates/HelloWorld/android/build.gradle#L21
url "$projectDir/../node_modules/react-native/android"
}
mavenCentral()
google()
}

dependencies {
if (isNewArchitectureEnabled()) {
implementation project(":ReactAndroid")
implementation("com.facebook.react:react-android")
} else {
implementation 'com.facebook.react:react-native:+'
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,20 @@ public void onSuccess(DTBAdResponse response) {

sendEvent(EVENT_SUCCESS, payload);
if (promise != null) {
promise.resolve(responseMap);
// Créer une copie pour promise.resolve car responseMap est déjà utilisé
WritableMap responseCopy = Arguments.createMap();
for (Map.Entry<String, List<String>> entry : customParams.entrySet()) {
List<String> values = entry.getValue();
StringBuilder valueBuilder = new StringBuilder();
for (int i = 0; i < values.size(); i++) {
valueBuilder.append(values.get(i));
if (i < values.size() - 1) {
valueBuilder.append(",");
}
}
responseCopy.putString(entry.getKey(), valueBuilder.toString());
}
promise.resolve(responseCopy);
promise = null;
}
}
Expand Down
Loading