Skip to content

Commit 18499b5

Browse files
authored
bump: example app RN version to 0.73.x (#74)
1 parent 305f980 commit 18499b5

File tree

23 files changed

+1812
-1051
lines changed

23 files changed

+1812
-1051
lines changed

example/Gemfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ source 'https://rubygems.org'
33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
44
ruby ">= 2.6.10"
55

6-
gem 'cocoapods', '~> 1.12'
6+
gem 'cocoapods', '~> 1.13'
7+
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'

example/android/app/build.gradle

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: "com.android.application"
2+
apply plugin: "org.jetbrains.kotlin.android"
23
apply plugin: "com.facebook.react"
34

45
/**
@@ -70,7 +71,8 @@ def jscFlavor = 'org.webkit:android-jsc:+'
7071

7172
android {
7273
ndkVersion rootProject.ext.ndkVersion
73-
compileSdkVersion rootProject.ext.compileSdkVersion
74+
buildToolsVersion rootProject.ext.buildToolsVersion
75+
compileSdk rootProject.ext.compileSdkVersion
7476

7577
namespace "com.example.reactnativeidscansdk"
7678
defaultConfig {
@@ -106,12 +108,7 @@ dependencies {
106108
// The version of react-native is set by the React Native Gradle Plugin
107109
implementation("com.facebook.react:react-android")
108110

109-
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
110-
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
111-
exclude group:'com.squareup.okhttp3', module:'okhttp'
112-
}
113-
114-
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
111+
implementation("com.facebook.react:flipper-integration")
115112
if (hermesEnabled.toBoolean()) {
116113
implementation("com.facebook.react:hermes-android")
117114
} else {

example/android/app/src/debug/AndroidManifest.xml

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,5 @@
77
<application
88
android:usesCleartextTraffic="true"
99
tools:targetApi="28"
10-
tools:ignore="GoogleAppIndexingWarning">
11-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
12-
</application>
10+
tools:ignore="GoogleAppIndexingWarning"/>
1311
</manifest>

example/android/app/src/debug/java/com/example/reactnativeidscansdk/ReactNativeFlipper.java

-72
This file was deleted.

example/android/app/src/main/java/com/example/reactnativeidscansdk/MainActivity.java

-32
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.example.reactnativeidscansdk
2+
3+
import com.facebook.react.ReactActivity
4+
import com.facebook.react.ReactActivityDelegate
5+
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
6+
import com.facebook.react.defaults.DefaultReactActivityDelegate
7+
8+
class MainActivity : ReactActivity() {
9+
10+
/**
11+
* Returns the name of the main component registered from JavaScript. This is used to schedule
12+
* rendering of the component.
13+
*/
14+
override fun getMainComponentName(): String = "IdscanSdkExample"
15+
16+
/**
17+
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
18+
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
19+
*/
20+
override fun createReactActivityDelegate(): ReactActivityDelegate =
21+
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
22+
}

example/android/app/src/main/java/com/example/reactnativeidscansdk/MainApplication.java

-62
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package com.example.reactnativeidscansdk
2+
3+
import android.app.Application
4+
import com.facebook.react.PackageList
5+
import com.facebook.react.ReactApplication
6+
import com.facebook.react.ReactHost
7+
import com.facebook.react.ReactNativeHost
8+
import com.facebook.react.ReactPackage
9+
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
10+
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
11+
import com.facebook.react.defaults.DefaultReactNativeHost
12+
import com.facebook.react.flipper.ReactNativeFlipper
13+
import com.facebook.soloader.SoLoader
14+
15+
class MainApplication : Application(), ReactApplication {
16+
17+
override val reactNativeHost: ReactNativeHost =
18+
object : DefaultReactNativeHost(this) {
19+
override fun getPackages(): List<ReactPackage> {
20+
// Packages that cannot be autolinked yet can be added manually here, for example:
21+
// packages.add(new MyReactNativePackage());
22+
return PackageList(this).packages
23+
}
24+
override fun getJSMainModuleName(): String = "index"
25+
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
26+
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
27+
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
28+
}
29+
30+
override val reactHost: ReactHost
31+
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
32+
33+
override fun onCreate() {
34+
super.onCreate()
35+
SoLoader.init(this, false)
36+
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
37+
// If you opted-in for the New Architecture, we load the native entry point for this app.
38+
load()
39+
}
40+
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
41+
}
42+
}

example/android/app/src/release/java/com/example/reactnativeidscansdk/ReactNativeFlipper.java

-18
This file was deleted.

example/android/build.gradle

+8-10
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22

33
buildscript {
44
ext {
5-
buildToolsVersion = "33.0.0"
5+
buildToolsVersion = "34.0.0"
66
minSdkVersion = 21
7-
compileSdkVersion = 33
8-
targetSdkVersion = 33
9-
10-
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
11-
ndkVersion = "23.1.7779620"
12-
13-
// kotlin version
14-
kotlinVersion = '1.6.20'
7+
compileSdkVersion = 34
8+
targetSdkVersion = 34
9+
ndkVersion = "25.1.8937393"
10+
kotlinVersion = "1.8.0"
1511
}
1612
repositories {
1713
google()
@@ -20,7 +16,7 @@ buildscript {
2016
dependencies {
2117
classpath("com.android.tools.build:gradle")
2218
classpath("com.facebook.react:react-native-gradle-plugin")
23-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
19+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
2420
}
2521
}
2622

@@ -31,3 +27,5 @@ allprojects {
3127
}
3228
}
3329
}
30+
31+
apply plugin: "com.facebook.react.rootproject"

example/android/gradle.properties

+5-3
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,18 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1818
# org.gradle.parallel=true
1919

20+
# AndroidX package structure to make it clearer which packages are bundled with the
21+
# Android operating system, and which are packaged with your app's APK
22+
# https://developer.android.com/topic/libraries/support-library/androidx-rn
2023
android.useAndroidX=true
24+
# Automatically convert third-party libraries to use AndroidX
2125
android.enableJetifier=true
2226

23-
# Version of flipper SDK to use with React Native
24-
FLIPPER_VERSION=0.182.0
25-
2627
# Use this property to specify which architecture you want to build.
2728
# You can also override it from the CLI using
2829
# ./gradlew <task> -PreactNativeArchitectures=x86_64
2930
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
31+
3032
# Use this property to enable support to the new architecture.
3133
# This will allow you to use TurboModules and the Fabric render in
3234
# your application. You should enable this flag either if you want
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)