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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 4 additions & 7 deletions
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

Lines changed: 1 addition & 3 deletions
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

Lines changed: 0 additions & 72 deletions
This file was deleted.

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

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
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

Lines changed: 0 additions & 62 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
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

Lines changed: 0 additions & 18 deletions
This file was deleted.

example/android/build.gradle

Lines changed: 8 additions & 10 deletions
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"

0 commit comments

Comments
 (0)