Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
0908370
chore: add version catalogs
uc-brunosouza Aug 10, 2025
991456d
chore: centralize java versions
uc-brunosouza Aug 10, 2025
1ed9d17
chore: update gradle plugin
uc-brunosouza Aug 10, 2025
47fda20
chore: remove namespace
uc-brunosouza Aug 11, 2025
8b5e101
chore: update project versions
uc-brunosouza Aug 11, 2025
7dc713f
chore: create patch versions
uc-brunosouza Aug 11, 2025
74efff3
chore: update patches
uc-brunosouza Aug 11, 2025
b6d6089
chore: update libraries version
uc-brunosouza Aug 11, 2025
40e57ad
chore: update gradle version
uc-brunosouza Aug 11, 2025
e7774c2
chore: delete patch
uc-brunosouza Aug 11, 2025
6c23d07
fix: android versions
uc-brunosouza Aug 11, 2025
491f776
chore: bump react native version
uc-brunosouza Aug 11, 2025
3cce3da
chore: update signature in MainApplication.kt
uc-brunosouza Aug 11, 2025
6f54776
chore: equalize android versions
uc-brunosouza Aug 11, 2025
7cb3dd9
chore: update patches
uc-brunosouza Aug 11, 2025
2ee4a3a
chore: update metro.config.js and babel.config.js
uc-brunosouza Aug 11, 2025
563b023
chore: update gradle scripts
uc-brunosouza Aug 11, 2025
f5c72fc
chore: add script clean-all-caches.sh
uc-brunosouza Aug 11, 2025
5a75d43
chore: add script install-dependencies.sh and run-android.sh
uc-brunosouza Aug 11, 2025
4e0c18c
chore: update README.md
uc-brunosouza Aug 11, 2025
367539d
chore: remove unnecessary parameter at script
uc-brunosouza Aug 11, 2025
7c2f4f6
chore: enable flipper
uc-brunosouza Aug 11, 2025
6c636eb
chore: improve scrip clean-all-caches.sh
uc-brunosouza Aug 11, 2025
1bef4ee
backup: Estado atual antes da atualização RN 0.74.3 -> 0.81.0
uc-brunosouza Aug 14, 2025
8a38fcd
fabric, new architecture enabled with centralized versions
uc-brunosouza Aug 14, 2025
4234ff2
chore: fix react native imports
uc-brunosouza Aug 14, 2025
23ad132
fix: webview integrations
uc-brunosouza Aug 14, 2025
b395712
feat: Enable new architecture
uc-brunosouza Aug 18, 2025
1468217
chore: add autolinking task generation
uc-brunosouza Aug 18, 2025
bba8b9e
chore: adjust android script
uc-brunosouza Aug 18, 2025
a2f1ec7
chore: adjust script messages
uc-brunosouza Aug 18, 2025
72db999
chore: update scripts
uc-brunosouza Sep 12, 2025
aaa7570
chore: create new sample with new requirements
uc-brunosouza Sep 12, 2025
45809c6
chore: enable new architecture in sample
uc-brunosouza Sep 13, 2025
22654ff
chore: update sample versions
uc-brunosouza Sep 13, 2025
3e7405b
chore: add integration with usercentrics sdk
uc-brunosouza Sep 13, 2025
de847e0
chore: create legacy sample
uc-brunosouza Sep 13, 2025
a09154d
chore: legacy-sample ios adjust
uc-brunosouza Sep 13, 2025
3dab201
fix: budle id
uc-brunosouza Sep 13, 2025
eb2b936
fix: add nullsafety in files
uc-brunosouza Sep 14, 2025
eb60c48
chore: update versions libs.versions.toml
uc-brunosouza Sep 14, 2025
b83c460
chore: remove sample
uc-brunosouza Sep 14, 2025
fdc6ee4
fix: git files
souzabrunoj Sep 14, 2025
a0ac6ec
chore: improve android configs
uc-brunosouza Sep 14, 2025
987b2e5
chore: improve ios configs
souzabrunoj Sep 14, 2025
4d31058
chore: improve ios configs
souzabrunoj Sep 14, 2025
a505de6
chore: migration integrations
souzabrunoj Sep 14, 2025
5212770
chore: revert sample
souzabrunoj Sep 14, 2025
326fddd
chore: add image support
souzabrunoj Sep 14, 2025
e916318
chore: some adjusts at sdk
souzabrunoj Sep 14, 2025
5ccbf15
chore: create empty sample
souzabrunoj Sep 15, 2025
8c245d7
chore: add sdk integration
souzabrunoj Sep 15, 2025
2c92977
chore: integration sdk at sample, ios is running
souzabrunoj Sep 15, 2025
bcdf685
chore: migrate sdk integrate classes
souzabrunoj Sep 15, 2025
968e7ed
feat: integrate new sample into SDK with Android support
souzabrunoj Sep 15, 2025
d148f09
feat: ios sample is running
souzabrunoj Sep 15, 2025
f958b19
feat: update scripts
souzabrunoj Sep 15, 2025
43cc3cb
feat: set gradle wrapper version
souzabrunoj Sep 16, 2025
61f53b6
chore: equalize react native versions
souzabrunoj Sep 16, 2025
fa01495
chore: update sample
souzabrunoj Sep 17, 2025
a875956
chore: update react native version
souzabrunoj Sep 17, 2025
3783b11
chore: update react native version
souzabrunoj Sep 17, 2025
93a2f1f
chore: convert gradle files to kotlin
souzabrunoj Sep 17, 2025
e24983b
chore: gradle kotlin version
souzabrunoj Sep 26, 2025
b210f6a
Merge remote-tracking branch 'origin/master' into feat/create-sample-…
souzabrunoj Sep 30, 2025
7b0bccc
chore: update usercentricsVersion
souzabrunoj Sep 30, 2025
e4acc19
chore: bump node version at ci files
souzabrunoj Sep 30, 2025
67245f9
chore: skip tests steps
souzabrunoj Sep 30, 2025
7cb0659
chore: revert ci changes
souzabrunoj Oct 1, 2025
c5424d1
chore: revert ci changes
souzabrunoj Oct 1, 2025
e40e945
chore: revert ci changes
souzabrunoj Oct 1, 2025
39bd887
Merge remote-tracking branch 'origin/master' into fix/ci-steps-and-un…
souzabrunoj Oct 1, 2025
3063535
chore: add gradle-wrapper.jar
souzabrunoj Oct 1, 2025
279bbe7
Release: 2.23.1
uc-brunosilva Oct 1, 2025
0691649
Merge branch 'release/2.23.1' into fix/ci-steps-and-unit-tests
souzabrunoj Oct 1, 2025
c45f41d
chore: equalize android versions.
souzabrunoj Oct 1, 2025
54e81fa
fix: unit tests
souzabrunoj Oct 1, 2025
30bdd87
Merge remote-tracking branch 'origin/master' into fix/ci-steps-and-un…
souzabrunoj Oct 2, 2025
0551bb6
fix: ci test step
souzabrunoj Oct 2, 2025
65c644a
fix: move classes to correct folder
souzabrunoj Oct 3, 2025
709da7a
chore: create scripts to publish local version
souzabrunoj Oct 3, 2025
cf7a41e
chore: fix package at Main application
souzabrunoj Oct 5, 2025
deda347
Merge branch 'fix/ci-steps-and-unit-tests' into fix/cannot-find-symbo…
souzabrunoj Oct 5, 2025
b4d27fb
fix test package
souzabrunoj Oct 5, 2025
8de1372
fix: add correct import for UIColor+Extensions.swift and UIImage+User…
souzabrunoj Oct 6, 2025
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
159 changes: 79 additions & 80 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,87 +20,86 @@ jobs:
with:
node-version: ${{ env.NODE_JS_VERSION }}

- name: Run RN Tests
run: |
yarn install --frozen-lockfile
yarn test
- name: Install Dependencies
run: yarn install --frozen-lockfile

- name: Install TypeScript
run: yarn add --dev typescript@^5.6.3

- name: Compile TypeScript
run: yarn compile

- name: Run Tests
run: yarn test

- name: Assert that every file that should be public has been exported
run: ./scripts/assert_export.sh

# Temporary

# test-ios:
# needs: test-rn
# runs-on: macos-13
# defaults:
# run:
# working-directory: example

# steps:
# - uses: maxim-lobanov/setup-xcode@v1
# with:
# xcode-version: '14.2'

# - name: Checkout
# uses: actions/checkout@v2

# - name: Setup Node
# uses: actions/setup-node@v2
# with:
# node-version: ${{ env.NODE_JS_VERSION }}

# - name: Install dependencies
# run: yarn install --frozen-lockfile

# - name: Install pods
# run: cd ios && pod install

# - name: Run tests
# run: cd ios && xcodebuild -workspace example.xcworkspace -scheme "example" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14' test

# test-android:
# needs: test-rn
# runs-on: macOS-13
# env:
# GRADLE_VERSION: 7.6

# steps:
# - name: Checkout
# uses: actions/checkout@v4

# - name: Setup Node
# uses: actions/setup-node@v2
# with:
# node-version: ${{ env.NODE_JS_VERSION }}

# - name: Java 17
# uses: actions/setup-java@v1
# with:
# java-version: 17

# - name: Install Dependencies
# working-directory: ./example
# run: npm ci --legacy-peer-deps

# - name: Cache Gradle
# id: cache-gradle
# uses: actions/cache@v4
# with:
# path: |
# ./example/android/ci-cache/gradle
# ./example/android/gradle/wrapper/gradle-wrapper.jar
# ./example/android/gradlew
# key: ${{ runner.os }}-cache-gradle-${{ env.GRADLE_VERSION }}

# - name: Setup Gradle
# if: steps.cache-gradle.outputs.cache-hit != 'true'
# working-directory: ./example/android
# run: ../../scripts/setup_gradle.sh ${{ env.GRADLE_VERSION }}

# - name: Android tests
# uses: reactivecircus/android-emulator-runner@v2
# with:
# working-directory: ./example/android
# api-level: 29
# script: gradle wrapper; ./gradlew :react-native-usercentrics:connectedAndroidTest
test-ios:
needs: test-rn
runs-on: macos-13

steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.2'

- name: Checkout
uses: actions/checkout@v2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Update GitHub Actions versions.

Static analysis detected deprecated action versions that may fail on newer GitHub runners:

  • Line 48: actions/checkout@v2 → upgrade to @v4
  • Line 51: actions/setup-node@v2 → upgrade to @v4
  • Line 84: actions/setup-node@v2 → upgrade to @v4
  • Line 89: actions/setup-java@v1 → upgrade to @v4

Based on static analysis tool (actionlint).

Apply this diff:

-      - name: Checkout
-        uses: actions/checkout@v2
+      - name: Checkout
+        uses: actions/checkout@v4

-      - name: Setup Node
-        uses: actions/setup-node@v2
+      - name: Setup Node
+        uses: actions/setup-node@v4
         with:
           node-version: ${{ env.NODE_JS_VERSION }}

Similar updates for lines 84 and 89.

Also applies to: 51-51, 84-84, 89-89

🧰 Tools
🪛 actionlint (1.7.7)

48-48: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
.github/workflows/ci.yml lines 48, 51, 84 and 89: update deprecated GitHub
Action versions to their current stable major releases; replace
actions/checkout@v2 with actions/checkout@v4, replace actions/setup-node@v2 with
actions/setup-node@v4 at both line 51 and 84, and replace actions/setup-java@v1
with actions/setup-java@v4 at line 89; ensure there are no breaking
configuration changes required by the new majors (adjust inputs if needed) and
run the workflow linter or actionlint to validate the updated workflow.


- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_JS_VERSION }}

- name: Install SDK Dependencies
run: yarn install --frozen-lockfile

- name: Compile SDK
run: yarn compile

- name: Install Sample Dependencies
working-directory: ./sample
run: npm ci --legacy-peer-deps

- name: Install pods
working-directory: ./sample
run: cd ios && pod install

- name: Run tests
working-directory: ./sample
run: cd ios && xcodebuild -workspace sample.xcworkspace -scheme "sample" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14' test

test-android:
needs: test-rn
runs-on: macOS-13
env:
GRADLE_VERSION: 8.13

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_JS_VERSION }}

- name: Java 17
uses: actions/setup-java@v1
with:
java-version: 17

- name: Install SDK Dependencies
run: yarn install --frozen-lockfile

- name: Compile SDK
run: yarn compile

- name: Install Sample Dependencies (needed for Gradle build)
working-directory: ./sample
run: npm ci --legacy-peer-deps

- name: Run SDK Unit Tests
working-directory: ./sample/android
run: ./gradlew :react-native-usercentrics:test
14 changes: 13 additions & 1 deletion android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ android {

buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchEnabled.toString())
buildConfigField("boolean", "IS_HERMES_ENABLED", isHermesEnabled.toString())

ndk {
abiFilters += listOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
}
}

compileOptions {
Expand All @@ -45,7 +49,7 @@ android {
buildConfig = true
}

packagingOptions {
packaging {
jniLibs {
useLegacyPackaging = false
}
Expand All @@ -56,6 +60,14 @@ dependencies {
implementation("com.facebook.react:react-android:$reactNativeVersion")
implementation("com.usercentrics.sdk:usercentrics-ui:$usercentricsVersion")

// Unit tests (JVM)
testImplementation("junit:junit:4.13.2")
testImplementation("io.mockk:mockk:1.13.12")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.9.0")
testImplementation("com.facebook.react:react-android:$reactNativeVersion")

// Instrumented tests (Android)
androidTestImplementation("com.facebook.react:react-android:$reactNativeVersion")
androidTestImplementation("io.mockk:mockk-android:1.12.0")
androidTestImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit-ktx:1.1.3")
Expand Down
4 changes: 4 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
org.gradle.jvmargs=-Xmx2048M
android.useAndroidX=true
android.enableJetifier=true

reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64

hermesEnabled=true
2 changes: 1 addition & 1 deletion android/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pluginManagement {
gradlePluginPortal()
}
plugins {
id("org.jetbrains.kotlin.android") version "2.1.20"
id("org.jetbrains.kotlin.android") version "2.0.21"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,11 @@ class RNUsercentricsModuleTest {
val result = promise.resolveValue as WritableArray
val consent = result.getMap(0)

assertEquals(false, consent.getBoolean("status"))
assertEquals("ocv9HNX_g", consent.getString("templateId"))
assertEquals("Facebook SDK", consent.getString("dataProcessor"))
assertEquals(0, consent.getInt("type"))
assertEquals("1.0.1", consent.getString("version"))
assertEquals(false, consent?.getBoolean("status"))
assertEquals("ocv9HNX_g", consent?.getString("templateId"))
assertEquals("Facebook SDK", consent?.getString("dataProcessor"))
assertEquals(0, consent?.getInt("type"))
assertEquals("1.0.1", consent?.getString("version"))
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package com.usercentrics.reactnativemodule.fake
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: Package declaration doesn't match file path.

The package declaration com.usercentrics.reactnativemodule.fake conflicts with the file path android/src/androidTest/java/com/usercentrics/reactnative/fake/FakePromise.kt, which implies the package should be com.usercentrics.reactnative.fake.

This mismatch will cause compilation errors as the compiler expects the package to match the directory structure.

Apply this diff to fix the package declaration:

-package com.usercentrics.reactnativemodule.fake
+package com.usercentrics.reactnative.fake
🤖 Prompt for AI Agents
In android/src/androidTest/java/com/usercentrics/reactnative/fake/FakePromise.kt
around line 1 the package declaration is incorrect: it currently reads
com.usercentrics.reactnativemodule.fake but must match the directory path
com.usercentrics.reactnative.fake; update the package declaration to
com.usercentrics.reactnative.fake so the package name matches the file path to
resolve the compilation error.


import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.WritableMap
import java.util.concurrent.CountDownLatch

internal class FakePromise : Promise {

var resolveValue: Any? = null
var rejectThrowable: Throwable? = null

private val lock = CountDownLatch(1)

fun await() {
lock.await()
}

override fun resolve(value: Any?) {
resolveValue = value
lock.countDown()
}

override fun reject(code: String, message: String?) {
rejectThrowable = RuntimeException("$code: $message")
lock.countDown()
}

override fun reject(code: String, throwable: Throwable?) {
rejectThrowable = throwable ?: RuntimeException(code)
lock.countDown()
}

override fun reject(code: String, message: String?, throwable: Throwable?) {
rejectThrowable = throwable ?: RuntimeException("$code: $message")
lock.countDown()
}

override fun reject(throwable: Throwable) {
rejectThrowable = throwable
lock.countDown()
}

override fun reject(throwable: Throwable, userInfo: WritableMap) {
rejectThrowable = throwable
lock.countDown()
}

override fun reject(code: String, userInfo: WritableMap) {
rejectThrowable = RuntimeException("$code: $userInfo")
lock.countDown()
}

override fun reject(code: String, throwable: Throwable?, userInfo: WritableMap) {
rejectThrowable = throwable
lock.countDown()
}

override fun reject(code: String, message: String?, userInfo: WritableMap) {
rejectThrowable = RuntimeException("$code: $message")
lock.countDown()
}

override fun reject(code: String?, message: String?, throwable: Throwable?, userInfo: WritableMap?) {
rejectThrowable = throwable ?: RuntimeException("$code: $message")
lock.countDown()
}

@Deprecated("Use reject(code, message) instead")
override fun reject(message: String) {
rejectThrowable = RuntimeException(message)
lock.countDown()
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.usercentrics.reactnativeusercentrics
package com.usercentrics.reactnative

import com.facebook.react.bridge.*
import com.usercentrics.reactnativeusercentrics.api.UsercentricsProxy
import com.usercentrics.reactnativeusercentrics.extensions.*
import com.usercentrics.reactnative.api.UsercentricsProxy
import com.usercentrics.reactnative.extensions.*
import com.usercentrics.sdk.UsercentricsAnalyticsEventType
import com.usercentrics.sdk.models.settings.UsercentricsConsentType
import com.usercentrics.sdk.services.tcf.TCFDecisionUILayer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.usercentrics.reactnativeusercentrics
package com.usercentrics.reactnative

import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReactApplicationContext
Expand Down
Loading
Loading