diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fdc143f3..a1721406 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -138,7 +138,7 @@ jobs: test_ios: name: Testing iOS needs: test_js - runs-on: macos-14 + runs-on: macos-15 defaults: run: working-directory: test @@ -173,7 +173,7 @@ jobs: -workspace "Didomi Tests.xcworkspace" \ -scheme "Didomi Tests" \ -sdk iphonesimulator \ - -destination "platform=iOS Simulator,name=iPhone 15" \ + -destination "platform=iOS Simulator,name=iPhone 17" \ clean test # Archive Result if failure diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a75c3c2f..6fcb5f9f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -137,7 +137,7 @@ jobs: ios: needs: js - runs-on: macos-14 + runs-on: macos-15 defaults: run: working-directory: test @@ -173,7 +173,7 @@ jobs: -workspace "Didomi Tests.xcworkspace" \ -scheme "Didomi Tests" \ -sdk iphonesimulator \ - -destination "platform=iOS Simulator,name=iPhone 15" \ + -destination "platform=iOS Simulator,name=iPhone 17" \ clean test # Archive Result if failure diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 5c9c4c45..573ad6f9 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -20,7 +20,7 @@ concurrency: jobs: update: name: Update version and dependencies - runs-on: macos-14 # required for pod info / update + runs-on: macos-15 # required for pod info / update steps: - name: Checkout diff --git a/.gitignore b/.gitignore index 13bc14b0..2381a4ad 100644 --- a/.gitignore +++ b/.gitignore @@ -79,3 +79,6 @@ package-lock.json Podfile.lock yarn.lock index.android.bundle + +# AI generated files +CLAUDE.md diff --git a/android/build.gradle b/android/build.gradle index ef67b4b3..7112b8ee 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -46,7 +46,7 @@ android { minifyEnabled false } } - lintOptions { + lint { disable "GradleCompatible" } compileOptions { diff --git a/android/gradle.properties b/android/gradle.properties index fb828ab2..fd0c5191 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,6 +1,6 @@ -Didomi_kotlinVersion=1.9.24 +Didomi_kotlinVersion=2.1.20 -Didomi_buildToolsVersion=35.0.0 -Didomi_compileSdkVersion=35 +Didomi_buildToolsVersion=36.0.0 +Didomi_compileSdkVersion=36 Didomi_minSdkVersion=21 -Didomi_targetSdkVersion=35 +Didomi_targetSdkVersion=36 diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index ed4c299a..d4081da4 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/package.json b/package.json index 69c982c8..eb1f3651 100644 --- a/package.json +++ b/package.json @@ -50,18 +50,20 @@ "publishConfig": { "registry": "https://registry.npmjs.org/" }, + "engines": { + "node": ">=20" + }, "devDependencies": { - "@rnx-kit/metro-config": "^1.3.15", - "@types/jest": "^26.0.0", - "@types/react": "^18.3.3", + "@rnx-kit/metro-config": "^2.1.0", + "@types/jest": "^29.5.0", + "@types/react": "^19.1.0", "jest": "^29.7.0", - "metro-config": "^0.80.9", "pod-install": "^0.2.2", - "react": "18.2.0", - "react-native": "0.73.8", - "react-native-builder-bob": "^0.29.1", + "react": "19.1.0", + "react-native": "0.81.5", + "react-native-builder-bob": "^0.40.0", "react-native-monorepo-tools": "^1.2.1", - "typescript": "^5.0.4" + "typescript": "^5.6.0" }, "peerDependencies": { "react": "*", diff --git a/react-native-didomi.podspec b/react-native-didomi.podspec index 1963211b..ebd7688a 100644 --- a/react-native-didomi.podspec +++ b/react-native-didomi.podspec @@ -10,7 +10,7 @@ Pod::Spec.new do |s| s.license = package["license"] s.authors = package["author"] - s.platforms = { :ios => "11.0", :tvos => "11.0" } + s.platforms = { :ios => "15.1", :tvos => "15.1" } s.source = { :git => "https://github.com/didomi/react-native.git", :tag => "#{s.version}" } s.source_files = "ios/**/*.{h,m,mm,swift}" diff --git a/sample/Gemfile b/sample/Gemfile index 8d72c37a..7e6fe591 100644 --- a/sample/Gemfile +++ b/sample/Gemfile @@ -3,7 +3,14 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby ">= 2.6.10" -# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper -# bound in the template on Cocoapods with next React Native release. -gem 'cocoapods', '>= 1.13', '< 1.15' -gem 'activesupport', '>= 6.1.7.5', '< 7.1.0' +# Exclude problematic versions of cocoapods and activesupport that causes build failures. +gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1' +gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0' +gem 'xcodeproj', '< 1.26.0' + +# Ruby 3.4.0 compatibility +gem 'concurrent-ruby', '< 1.3.4' +gem 'bigdecimal' +gem 'logger' +gem 'benchmark' +gem 'mutex_m' diff --git a/sample/Gemfile.lock b/sample/Gemfile.lock index 704f6715..060e38d8 100644 --- a/sample/Gemfile.lock +++ b/sample/Gemfile.lock @@ -18,6 +18,8 @@ GEM json (>= 1.5.1) atomos (0.1.3) base64 (0.2.0) + benchmark (0.5.0) + bigdecimal (3.3.1) claide (1.1.0) cocoapods (1.14.3) addressable (~> 2.8) @@ -69,8 +71,10 @@ GEM i18n (1.14.5) concurrent-ruby (~> 1.0) json (2.7.2) + logger (1.7.0) minitest (5.24.1) molinillo (0.8.0) + mutex_m (0.3.0) nanaimo (0.3.0) nap (1.1.0) netrc (0.11.0) @@ -97,8 +101,14 @@ PLATFORMS ruby DEPENDENCIES - activesupport (>= 6.1.7.5, < 7.1.0) - cocoapods (>= 1.13, < 1.15) + activesupport (>= 6.1.7.5, != 7.1.0) + benchmark + bigdecimal + cocoapods (>= 1.13, != 1.15.1, != 1.15.0) + concurrent-ruby (< 1.3.4) + logger + mutex_m + xcodeproj (< 1.26.0) RUBY VERSION ruby 2.6.10p210 diff --git a/sample/android/app/build.gradle b/sample/android/app/build.gradle index 66ecef7a..635af44e 100644 --- a/sample/android/app/build.gradle +++ b/sample/android/app/build.gradle @@ -8,14 +8,11 @@ apply plugin: "com.facebook.react" */ react { /* Folders */ - // The root of your project, i.e. where "package.json" lives. Default is '..' - // root = file("../") - // The folder where the react-native NPM package is. Default is ../node_modules/react-native - // reactNativeDir = file("../node_modules/react-native") - // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen - // codegenDir = file("../node_modules/@react-native/codegen") - // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js - // cliFile = file("../node_modules/react-native/cli.js") + // Monorepo setup: node_modules is at root level + root = file("../../") + reactNativeDir = file("../../../node_modules/react-native") + codegenDir = file("../../../node_modules/@react-native/codegen") + cliFile = file("../../../node_modules/react-native/cli.js") /* Variants */ // The list of variants to that are debuggable. For those we're going to @@ -49,6 +46,9 @@ react { // // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" // hermesFlags = ["-O", "-output-source-map"] + + /* Autolinking */ + autolinkLibrariesWithApp() } /** @@ -67,7 +67,7 @@ def enableProguardInReleaseBuilds = false * give correct results when using with locales other than en-US. Note that * this variant is about 6MiB larger per architecture than default. */ -def jscFlavor = 'org.webkit:android-jsc:+' +def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+' android { ndkVersion rootProject.ext.ndkVersion @@ -119,5 +119,3 @@ dependencies { implementation jscFlavor } } - -apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) diff --git a/sample/android/app/src/main/AndroidManifest.xml b/sample/android/app/src/main/AndroidManifest.xml index b69cb2c0..69ba5d8f 100644 --- a/sample/android/app/src/main/AndroidManifest.xml +++ b/sample/android/app/src/main/AndroidManifest.xml @@ -8,7 +8,8 @@ android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" - android:theme="@style/AppTheme"> + android:theme="@style/AppTheme" + android:supportsRtl="true"> ex.autolinkLibrariesFromCommand() } rootProject.name = 'Didomi Sample' -apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app' includeBuild('../../node_modules/@react-native/gradle-plugin') diff --git a/sample/ios/sample.xcodeproj/project.pbxproj b/sample/ios/sample.xcodeproj/project.pbxproj index 6bcc6f6b..adfc3ee1 100644 --- a/sample/ios/sample.xcodeproj/project.pbxproj +++ b/sample/ios/sample.xcodeproj/project.pbxproj @@ -9,9 +9,8 @@ /* Begin PBXBuildFile section */ 00E356F31AD99517003FC87E /* sampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* sampleTests.m */; }; 0C80B921A6F3F58F76C31292 /* libPods-sample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-sample.a */; }; - 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; - 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; + 21A147593EA0F391CBFFC0F7 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F03E12CD8292A266AED1F34 /* AppDelegate.swift */; }; 7699B88040F8A987B510C191 /* libPods-sample-sampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-sample-sampleTests.a */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 97D6A4DE2C5D70CA00769FD8 /* didomi_config.json in Resources */ = {isa = PBXBuildFile; fileRef = 97D6A4DD2C5D70CA00769FD8 /* didomi_config.json */; }; @@ -33,11 +32,8 @@ 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 00E356F21AD99517003FC87E /* sampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = sampleTests.m; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = sample/AppDelegate.h; sourceTree = ""; }; - 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = sample/AppDelegate.mm; sourceTree = ""; }; 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = sample/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = sample/Info.plist; sourceTree = ""; }; - 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = sample/main.m; sourceTree = ""; }; 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = sample/PrivacyInfo.xcprivacy; sourceTree = ""; }; 19F6CBCC0A4E27FBF8BF4A61 /* libPods-sample-sampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-sample-sampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 3B4392A12AC88292D35C810B /* Pods-sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-sample.debug.xcconfig"; path = "Target Support Files/Pods-sample/Pods-sample.debug.xcconfig"; sourceTree = ""; }; @@ -45,6 +41,7 @@ 5A042DEEE1B6ABCCD9D8E5FC /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = sample/PrivacyInfo.xcprivacy; sourceTree = ""; }; 5B7EB9410499542E8C5724F5 /* Pods-sample-sampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-sample-sampleTests.debug.xcconfig"; path = "Target Support Files/Pods-sample-sampleTests/Pods-sample-sampleTests.debug.xcconfig"; sourceTree = ""; }; 5DCACB8F33CDC322A6C60F78 /* libPods-sample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-sample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 5F03E12CD8292A266AED1F34 /* AppDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = sample/AppDelegate.swift; sourceTree = ""; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = sample/LaunchScreen.storyboard; sourceTree = ""; }; 89C6BE57DB24E9ADA2F236DE /* Pods-sample-sampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-sample-sampleTests.release.xcconfig"; path = "Target Support Files/Pods-sample-sampleTests/Pods-sample-sampleTests.release.xcconfig"; sourceTree = ""; }; 97D6A4DD2C5D70CA00769FD8 /* didomi_config.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = didomi_config.json; path = sample/didomi_config.json; sourceTree = ""; }; @@ -92,14 +89,12 @@ isa = PBXGroup; children = ( 97D6A4DA2C5D6E3500769FD8 /* Resources */, - 13B07FAF1A68108700A75B9A /* AppDelegate.h */, - 13B07FB01A68108700A75B9A /* AppDelegate.mm */, 13B07FB51A68108700A75B9A /* Images.xcassets */, 13B07FB61A68108700A75B9A /* Info.plist */, 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, - 13B07FB71A68108700A75B9A /* main.m */, 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */, 5A042DEEE1B6ABCCD9D8E5FC /* PrivacyInfo.xcprivacy */, + 5F03E12CD8292A266AED1F34 /* AppDelegate.swift */, ); name = sample; sourceTree = ""; @@ -410,8 +405,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */, - 13B07FC11A68108700A75B9A /* main.m in Sources */, + 21A147593EA0F391CBFFC0F7 /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -437,7 +431,7 @@ "$(inherited)", ); INFOPLIST_FILE = sampleTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.4; + IPHONEOS_DEPLOYMENT_TARGET = 15.1; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -462,7 +456,7 @@ COPY_PHASE_STRIP = NO; DEVELOPMENT_TEAM = M8WSGVXRUU; INFOPLIST_FILE = sampleTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.4; + IPHONEOS_DEPLOYMENT_TARGET = 15.1; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -586,7 +580,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.4; + IPHONEOS_DEPLOYMENT_TARGET = 15.1; LD = ""; LDPLUSPLUS = ""; LD_RUNPATH_SEARCH_PATHS = ( @@ -612,8 +606,9 @@ "$(inherited)", " ", ); - REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; + REACT_NATIVE_PATH = "${PODS_ROOT}/../../../node_modules/react-native"; SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; USE_HERMES = true; }; name = Debug; @@ -662,7 +657,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.4; + IPHONEOS_DEPLOYMENT_TARGET = 15.1; LD = ""; LDPLUSPLUS = ""; LD_RUNPATH_SEARCH_PATHS = ( @@ -687,7 +682,7 @@ "$(inherited)", " ", ); - REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; + REACT_NATIVE_PATH = "${PODS_ROOT}/../../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = true; VALIDATE_PRODUCT = YES; diff --git a/sample/ios/sample/AppDelegate.h b/sample/ios/sample/AppDelegate.h deleted file mode 100644 index 5d280825..00000000 --- a/sample/ios/sample/AppDelegate.h +++ /dev/null @@ -1,6 +0,0 @@ -#import -#import - -@interface AppDelegate : RCTAppDelegate - -@end diff --git a/sample/ios/sample/AppDelegate.mm b/sample/ios/sample/AppDelegate.mm deleted file mode 100644 index a76906c9..00000000 --- a/sample/ios/sample/AppDelegate.mm +++ /dev/null @@ -1,31 +0,0 @@ -#import "AppDelegate.h" - -#import - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - self.moduleName = @"sample"; - // You can add your custom initial props in the dictionary below. - // They will be passed down to the ViewController used by React Native. - self.initialProps = @{}; - - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge -{ - return [self bundleURL]; -} - -- (NSURL *)bundleURL -{ -#if DEBUG - return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; -#else - return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; -#endif -} - -@end diff --git a/sample/ios/sample/AppDelegate.swift b/sample/ios/sample/AppDelegate.swift new file mode 100644 index 00000000..86d67f4a --- /dev/null +++ b/sample/ios/sample/AppDelegate.swift @@ -0,0 +1,48 @@ +import UIKit +import React +import React_RCTAppDelegate +import ReactAppDependencyProvider + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + var window: UIWindow? + + var reactNativeDelegate: ReactNativeDelegate? + var reactNativeFactory: RCTReactNativeFactory? + + func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil + ) -> Bool { + let delegate = ReactNativeDelegate() + let factory = RCTReactNativeFactory(delegate: delegate) + delegate.dependencyProvider = RCTAppDependencyProvider() + + reactNativeDelegate = delegate + reactNativeFactory = factory + + window = UIWindow(frame: UIScreen.main.bounds) + + factory.startReactNative( + withModuleName: "sample", + in: window, + launchOptions: launchOptions + ) + + return true + } +} + +class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate { + override func sourceURL(for bridge: RCTBridge) -> URL? { + self.bundleURL() + } + + override func bundleURL() -> URL? { + #if DEBUG + RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index") + #else + Bundle.main.url(forResource: "main", withExtension: "jsbundle") + #endif + } +} diff --git a/sample/ios/sample/Info.plist b/sample/ios/sample/Info.plist index 3caddebb..65c648e3 100644 --- a/sample/ios/sample/Info.plist +++ b/sample/ios/sample/Info.plist @@ -33,6 +33,8 @@ NSLocationWhenInUseUsageDescription + RCTNewArchEnabled + UILaunchStoryboardName LaunchScreen UIRequiredDeviceCapabilities diff --git a/sample/ios/sample/main.m b/sample/ios/sample/main.m deleted file mode 100644 index d645c724..00000000 --- a/sample/ios/sample/main.m +++ /dev/null @@ -1,10 +0,0 @@ -#import - -#import "AppDelegate.h" - -int main(int argc, char *argv[]) -{ - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/sample/package.json b/sample/package.json index a166aa08..7bdc9f93 100644 --- a/sample/package.json +++ b/sample/package.json @@ -12,30 +12,33 @@ }, "dependencies": { "@didomi/react-native": "*", - "react": "18.2.0", - "react-native": "0.74.4" + "react": "19.1.0", + "react-native": "0.81.5", + "react-native-safe-area-context": "^5.4.0" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", - "@react-native/babel-preset": "0.74.86", - "@react-native/eslint-config": "0.74.86", - "@react-native/metro-config": "0.74.86", - "@react-native/typescript-config": "0.74.86", - "@rnx-kit/metro-config": "^1.3.15", - "@types/react": "^18.2.6", - "@types/react-test-renderer": "^18.0.0", + "@react-native-community/cli": "20.0.0", + "@react-native-community/cli-platform-android": "20.0.0", + "@react-native-community/cli-platform-ios": "20.0.0", + "@react-native/babel-preset": "0.81.5", + "@react-native/eslint-config": "0.81.5", + "@react-native/metro-config": "0.81.5", + "@react-native/typescript-config": "0.81.5", + "@rnx-kit/metro-config": "^2.1.0", + "@types/react": "^19.1.0", + "@types/react-test-renderer": "^19.1.0", "babel-jest": "^29.6.3", "eslint": "^8.19.0", "jest": "^29.6.3", - "metro-config": "^0.80.9", - "prettier": "2.8.8", + "prettier": "^3.4.0", "react-native-monorepo-tools": "^1.2.1", - "react-test-renderer": "18.2.0", - "typescript": "5.0.4" + "react-test-renderer": "19.1.0", + "typescript": "^5.8.3" }, "engines": { - "node": ">=18" + "node": ">=20" } } diff --git a/sample/src/App.tsx b/sample/src/App.tsx index 252b7e8b..c3d3b293 100644 --- a/sample/src/App.tsx +++ b/sample/src/App.tsx @@ -1,6 +1,7 @@ import React, { useState } from 'react'; -import { SafeAreaView, ScrollView, StyleSheet, Text, View } from 'react-native'; +import { ScrollView, StyleSheet, Text, View } from 'react-native'; +import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context'; import { Didomi, DidomiEventType } from '@didomi/react-native'; import Methods from './Methods'; import Getters from './Getters'; @@ -101,24 +102,26 @@ function App() { } return ( - - - - LAST RECEIVED EVENTS: - { displayEvents() } - - - - - METHODS - - GETTERS - - SETTERS - + + + + + LAST RECEIVED EVENTS: + { displayEvents() } + - - + + + METHODS + + GETTERS + + SETTERS + + + + + ); } diff --git a/test/Gemfile b/test/Gemfile index 8d72c37a..7e6fe591 100644 --- a/test/Gemfile +++ b/test/Gemfile @@ -3,7 +3,14 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby ">= 2.6.10" -# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper -# bound in the template on Cocoapods with next React Native release. -gem 'cocoapods', '>= 1.13', '< 1.15' -gem 'activesupport', '>= 6.1.7.5', '< 7.1.0' +# Exclude problematic versions of cocoapods and activesupport that causes build failures. +gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1' +gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0' +gem 'xcodeproj', '< 1.26.0' + +# Ruby 3.4.0 compatibility +gem 'concurrent-ruby', '< 1.3.4' +gem 'bigdecimal' +gem 'logger' +gem 'benchmark' +gem 'mutex_m' diff --git a/test/Gemfile.lock b/test/Gemfile.lock index 704f6715..060e38d8 100644 --- a/test/Gemfile.lock +++ b/test/Gemfile.lock @@ -18,6 +18,8 @@ GEM json (>= 1.5.1) atomos (0.1.3) base64 (0.2.0) + benchmark (0.5.0) + bigdecimal (3.3.1) claide (1.1.0) cocoapods (1.14.3) addressable (~> 2.8) @@ -69,8 +71,10 @@ GEM i18n (1.14.5) concurrent-ruby (~> 1.0) json (2.7.2) + logger (1.7.0) minitest (5.24.1) molinillo (0.8.0) + mutex_m (0.3.0) nanaimo (0.3.0) nap (1.1.0) netrc (0.11.0) @@ -97,8 +101,14 @@ PLATFORMS ruby DEPENDENCIES - activesupport (>= 6.1.7.5, < 7.1.0) - cocoapods (>= 1.13, < 1.15) + activesupport (>= 6.1.7.5, != 7.1.0) + benchmark + bigdecimal + cocoapods (>= 1.13, != 1.15.1, != 1.15.0) + concurrent-ruby (< 1.3.4) + logger + mutex_m + xcodeproj (< 1.26.0) RUBY VERSION ruby 2.6.10p210 diff --git a/test/android/app/build.gradle b/test/android/app/build.gradle index 3d912183..9646c013 100644 --- a/test/android/app/build.gradle +++ b/test/android/app/build.gradle @@ -8,14 +8,11 @@ apply plugin: "com.facebook.react" */ react { /* Folders */ - // The root of your project, i.e. where "package.json" lives. Default is '..' - // root = file("../") - // The folder where the react-native NPM package is. Default is ../node_modules/react-native - // reactNativeDir = file("../node_modules/react-native") - // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen - // codegenDir = file("../node_modules/@react-native/codegen") - // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js - // cliFile = file("../node_modules/react-native/cli.js") + // Monorepo setup: node_modules is at root level + root = file("../../") + reactNativeDir = file("../../../node_modules/react-native") + codegenDir = file("../../../node_modules/@react-native/codegen") + cliFile = file("../../../node_modules/react-native/cli.js") /* Variants */ // The list of variants to that are debuggable. For those we're going to @@ -49,6 +46,9 @@ react { // // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" // hermesFlags = ["-O", "-output-source-map"] + + /* Autolinking */ + autolinkLibrariesWithApp() } /** @@ -67,7 +67,7 @@ def enableProguardInReleaseBuilds = false * give correct results when using with locales other than en-US. Note that * this variant is about 6MiB larger per architecture than default. */ -def jscFlavor = 'org.webkit:android-jsc:+' +def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+' android { ndkVersion rootProject.ext.ndkVersion @@ -138,5 +138,3 @@ dependencies { androidTestUtil("androidx.test:orchestrator:1.5.0") } - -apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) diff --git a/test/android/app/src/main/AndroidManifest.xml b/test/android/app/src/main/AndroidManifest.xml index b69cb2c0..69ba5d8f 100644 --- a/test/android/app/src/main/AndroidManifest.xml +++ b/test/android/app/src/main/AndroidManifest.xml @@ -8,7 +8,8 @@ android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" - android:theme="@style/AppTheme"> + android:theme="@style/AppTheme" + android:supportsRtl="true"> ex.autolinkLibrariesFromCommand() } rootProject.name = 'Didomi Tests' -apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app' includeBuild('../../node_modules/@react-native/gradle-plugin') diff --git a/test/ios/Didomi Tests.xcodeproj/project.pbxproj b/test/ios/Didomi Tests.xcodeproj/project.pbxproj index 6ab13c83..b71179e6 100644 --- a/test/ios/Didomi Tests.xcodeproj/project.pbxproj +++ b/test/ios/Didomi Tests.xcodeproj/project.pbxproj @@ -8,10 +8,9 @@ /* Begin PBXBuildFile section */ 12BF9D2503C46768EB1C07BC /* libPods-Didomi-DidomiUITests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EEB337A0D598EE3EBA3A975D /* libPods-Didomi-DidomiUITests.a */; }; - 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; - 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; + 93A9F4BA21BA813BE755EBA3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B44C63D04295076FF117E997 /* AppDelegate.swift */; }; 97BCCB9F2C612B4C004A174C /* main.jsbundle in Resources */ = {isa = PBXBuildFile; fileRef = 97BCCB9E2C612B4C004A174C /* main.jsbundle */; }; 97CADCF52C60FB740078F82C /* didomi_config.json in Resources */ = {isa = PBXBuildFile; fileRef = 97CADCF42C60FB740078F82C /* didomi_config.json */; }; 97F130492C6B4F92009B8451 /* DidomiUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97BCCB942C612644004A174C /* DidomiUITests.swift */; }; @@ -36,11 +35,8 @@ /* Begin PBXFileReference section */ 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* test.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = test.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = test/AppDelegate.h; sourceTree = ""; }; - 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = test/AppDelegate.mm; sourceTree = ""; }; 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = test/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = test/Info.plist; sourceTree = ""; }; - 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = test/main.m; sourceTree = ""; }; 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = test/PrivacyInfo.xcprivacy; sourceTree = ""; }; 24D75B2A57B13B8E5B3FE75C /* Pods-Didomi.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Didomi.release.xcconfig"; path = "Target Support Files/Pods-Didomi/Pods-Didomi.release.xcconfig"; sourceTree = ""; }; 2AFB291E208CB482F751FBF0 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = test/PrivacyInfo.xcprivacy; sourceTree = ""; }; @@ -56,6 +52,7 @@ 97BCCB9E2C612B4C004A174C /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 97CADCF42C60FB740078F82C /* didomi_config.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = didomi_config.json; path = test/didomi_config.json; sourceTree = ""; }; 97F1303E2C6B4458009B8451 /* DidomiUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DidomiUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + B44C63D04295076FF117E997 /* AppDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = test/AppDelegate.swift; sourceTree = ""; }; D774C58514861B1B6382743B /* Pods-Didomi.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Didomi.debug.xcconfig"; path = "Target Support Files/Pods-Didomi/Pods-Didomi.debug.xcconfig"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; EEB337A0D598EE3EBA3A975D /* libPods-Didomi-DidomiUITests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Didomi-DidomiUITests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -104,14 +101,12 @@ isa = PBXGroup; children = ( 97CADCF32C60FB4E0078F82C /* Resources */, - 13B07FAF1A68108700A75B9A /* AppDelegate.h */, - 13B07FB01A68108700A75B9A /* AppDelegate.mm */, 13B07FB51A68108700A75B9A /* Images.xcassets */, 13B07FB61A68108700A75B9A /* Info.plist */, 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, - 13B07FB71A68108700A75B9A /* main.m */, 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */, 2AFB291E208CB482F751FBF0 /* PrivacyInfo.xcprivacy */, + B44C63D04295076FF117E997 /* AppDelegate.swift */, ); name = Didomi; sourceTree = ""; @@ -436,8 +431,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */, - 13B07FC11A68108700A75B9A /* main.m in Sources */, + 93A9F4BA21BA813BE755EBA3 /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -577,7 +571,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.4; + IPHONEOS_DEPLOYMENT_TARGET = 15.1; LD = ""; LDPLUSPLUS = ""; LD_RUNPATH_SEARCH_PATHS = ( @@ -604,8 +598,9 @@ "$(inherited)", " ", ); - REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; + REACT_NATIVE_PATH = "${PODS_ROOT}/../../../node_modules/react-native"; SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; USE_HERMES = true; }; name = Debug; @@ -654,7 +649,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.4; + IPHONEOS_DEPLOYMENT_TARGET = 15.1; LD = ""; LDPLUSPLUS = ""; LD_RUNPATH_SEARCH_PATHS = ( @@ -680,7 +675,7 @@ "$(inherited)", " ", ); - REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; + REACT_NATIVE_PATH = "${PODS_ROOT}/../../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = true; VALIDATE_PRODUCT = YES; @@ -705,7 +700,7 @@ ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu17; GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.4; + IPHONEOS_DEPLOYMENT_TARGET = 15.1; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; @@ -740,7 +735,7 @@ ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu17; GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.4; + IPHONEOS_DEPLOYMENT_TARGET = 15.1; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MARKETING_VERSION = 1.0; MTL_FAST_MATH = YES; diff --git a/test/ios/DidomiUITests/DidomiUITests.swift b/test/ios/DidomiUITests/DidomiUITests.swift index e3cf8083..f602817f 100644 --- a/test/ios/DidomiUITests/DidomiUITests.swift +++ b/test/ios/DidomiUITests/DidomiUITests.swift @@ -365,10 +365,11 @@ class DidomiUITests: XCTestCase { // The text might change every time we call the getUserStatus method // so we'll only assert the first level parameters of the resulting json string. - XCTAssertTrue(actual.contains("{\"legitimate_interest\":{\"enabled\":[")) - XCTAssertTrue(actual.contains(",\"global\":{\"enabled\":[")) - XCTAssertTrue(actual.contains(",\"essential\":[")) - XCTAssertTrue(actual.contains(",\"consent\":{\"enabled\":[")) + // Note: JSON key ordering is not guaranteed, so we check for key presence without relying on order. + XCTAssertTrue(actual.contains("\"legitimate_interest\":{\"enabled\":[")) + XCTAssertTrue(actual.contains("\"global\":{\"enabled\":[")) + XCTAssertTrue(actual.contains("\"essential\":[")) + XCTAssertTrue(actual.contains("\"consent\":{\"enabled\":[")) } func testGetUserStatus_Vendors() throws { diff --git a/test/ios/test/AppDelegate.h b/test/ios/test/AppDelegate.h deleted file mode 100644 index 5d280825..00000000 --- a/test/ios/test/AppDelegate.h +++ /dev/null @@ -1,6 +0,0 @@ -#import -#import - -@interface AppDelegate : RCTAppDelegate - -@end diff --git a/test/ios/test/AppDelegate.mm b/test/ios/test/AppDelegate.mm deleted file mode 100644 index 5fd37360..00000000 --- a/test/ios/test/AppDelegate.mm +++ /dev/null @@ -1,31 +0,0 @@ -#import "AppDelegate.h" - -#import - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - self.moduleName = @"test"; - // You can add your custom initial props in the dictionary below. - // They will be passed down to the ViewController used by React Native. - self.initialProps = @{}; - - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge -{ - return [self bundleURL]; -} - -- (NSURL *)bundleURL -{ -#if DEBUG - return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; -#else - return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; -#endif -} - -@end diff --git a/test/ios/test/AppDelegate.swift b/test/ios/test/AppDelegate.swift new file mode 100644 index 00000000..fc53c8a9 --- /dev/null +++ b/test/ios/test/AppDelegate.swift @@ -0,0 +1,48 @@ +import UIKit +import React +import React_RCTAppDelegate +import ReactAppDependencyProvider + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + var window: UIWindow? + + var reactNativeDelegate: ReactNativeDelegate? + var reactNativeFactory: RCTReactNativeFactory? + + func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil + ) -> Bool { + let delegate = ReactNativeDelegate() + let factory = RCTReactNativeFactory(delegate: delegate) + delegate.dependencyProvider = RCTAppDependencyProvider() + + reactNativeDelegate = delegate + reactNativeFactory = factory + + window = UIWindow(frame: UIScreen.main.bounds) + + factory.startReactNative( + withModuleName: "test", + in: window, + launchOptions: launchOptions + ) + + return true + } +} + +class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate { + override func sourceURL(for bridge: RCTBridge) -> URL? { + self.bundleURL() + } + + override func bundleURL() -> URL? { + #if DEBUG + RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index") + #else + Bundle.main.url(forResource: "main", withExtension: "jsbundle") + #endif + } +} diff --git a/test/ios/test/Info.plist b/test/ios/test/Info.plist index fb371352..d87da334 100644 --- a/test/ios/test/Info.plist +++ b/test/ios/test/Info.plist @@ -33,6 +33,8 @@ NSLocationWhenInUseUsageDescription + RCTNewArchEnabled + UILaunchStoryboardName LaunchScreen UIRequiredDeviceCapabilities diff --git a/test/ios/test/main.m b/test/ios/test/main.m deleted file mode 100644 index d645c724..00000000 --- a/test/ios/test/main.m +++ /dev/null @@ -1,10 +0,0 @@ -#import - -#import "AppDelegate.h" - -int main(int argc, char *argv[]) -{ - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/test/package.json b/test/package.json index 9d4073d6..bdb0c08d 100644 --- a/test/package.json +++ b/test/package.json @@ -12,30 +12,33 @@ }, "dependencies": { "@didomi/react-native": "*", - "react": "18.2.0", - "react-native": "0.73.9" + "react": "19.1.0", + "react-native": "0.81.5", + "react-native-safe-area-context": "^5.4.0" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", - "@react-native/babel-preset": "0.74.86", - "@react-native/eslint-config": "0.74.86", - "@react-native/metro-config": "0.74.86", - "@react-native/typescript-config": "0.74.86", - "@rnx-kit/metro-config": "^1.3.15", - "@types/react": "^18.2.6", - "@types/react-test-renderer": "^18.0.0", + "@react-native-community/cli": "20.0.0", + "@react-native-community/cli-platform-android": "20.0.0", + "@react-native-community/cli-platform-ios": "20.0.0", + "@react-native/babel-preset": "0.81.5", + "@react-native/eslint-config": "0.81.5", + "@react-native/metro-config": "0.81.5", + "@react-native/typescript-config": "0.81.5", + "@rnx-kit/metro-config": "^2.1.0", + "@types/react": "^19.1.0", + "@types/react-test-renderer": "^19.1.0", "babel-jest": "^29.6.3", "eslint": "^8.19.0", "jest": "^29.6.3", - "metro-config": "^0.80.9", - "prettier": "2.8.8", + "prettier": "^3.4.0", "react-native-monorepo-tools": "^1.2.1", - "react-test-renderer": "18.2.0", - "typescript": "5.0.4" + "react-test-renderer": "19.1.0", + "typescript": "^5.8.3" }, "engines": { - "node": ">=18" + "node": ">=20" } } diff --git a/test/src/App.tsx b/test/src/App.tsx index 079594b2..c864656a 100644 --- a/test/src/App.tsx +++ b/test/src/App.tsx @@ -1,6 +1,7 @@ import React, { useState } from 'react'; -import { SafeAreaView, ScrollView, StyleSheet, Text, View } from 'react-native'; +import { ScrollView, StyleSheet, Text, View } from 'react-native'; +import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context'; import { Didomi, DidomiEventType } from '@didomi/react-native'; import Methods from './Methods'; import Getters from './Getters'; @@ -120,40 +121,42 @@ function App() { } return ( - - - - SDK STATUS: {sdkStatus} - - - LAST RECEIVED EVENTS: - { displayEvents() } - - - - - INITIALIZE - - METHODS - pushReceivedEvent({ name: eventName }) } - registerAllListeners={() => registerAllListeners() } - /> - GETTERS - - GETTERS PARAMS - - SETTERS - - Current User Status Transactions - - SET USER - + + + + + SDK STATUS: {sdkStatus} + + + LAST RECEIVED EVENTS: + { displayEvents() } + - - + + + INITIALIZE + + METHODS + pushReceivedEvent({ name: eventName }) } + registerAllListeners={() => registerAllListeners() } + /> + GETTERS + + GETTERS PARAMS + + SETTERS + + Current User Status Transactions + + SET USER + + + + + ); }