Skip to content

Commit e5c08aa

Browse files
committed
example to 0.82.1
1 parent bff828e commit e5c08aa

File tree

5 files changed

+487
-456
lines changed

5 files changed

+487
-456
lines changed

Example/testHotUpdate/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ android {
8181
minSdkVersion rootProject.ext.minSdkVersion
8282
targetSdkVersion rootProject.ext.targetSdkVersion
8383
versionCode 1
84-
versionName "1.81.4"
84+
versionName "1.82.1"
8585
}
8686
signingConfigs {
8787
debug {

Example/testHotUpdate/android/app/src/main/java/com/awesomeproject/MainApplication.kt

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,26 @@
11
package com.awesomeproject
22

33
import android.app.Application
4-
import cn.reactnative.modules.update.UpdateContext
54
import com.facebook.react.PackageList
65
import com.facebook.react.ReactApplication
76
import com.facebook.react.ReactHost
87
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
9-
import com.facebook.react.ReactNativeHost
10-
import com.facebook.react.ReactPackage
118
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
12-
import com.facebook.react.defaults.DefaultReactNativeHost
9+
import cn.reactnative.modules.update.UpdateContext
1310

1411
class MainApplication : Application(), ReactApplication {
1512

16-
override val reactNativeHost: ReactNativeHost =
17-
object : DefaultReactNativeHost(this) {
18-
19-
override fun getJSBundleFile(): String? = UpdateContext.getBundleUrl(this@MainApplication)
20-
21-
override fun getPackages(): List<ReactPackage> =
22-
PackageList(this).packages.apply {
23-
// Packages that cannot be autolinked yet can be added manually here, for example:
24-
// add(MyReactNativePackage())
25-
}
26-
27-
override fun getJSMainModuleName(): String = "index"
28-
29-
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
30-
31-
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
32-
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
33-
}
34-
35-
override val reactHost: ReactHost
36-
get() = getDefaultReactHost(applicationContext, reactNativeHost)
13+
override val reactHost: ReactHost by lazy {
14+
getDefaultReactHost(
15+
context = applicationContext,
16+
packageList =
17+
PackageList(this).packages.apply {
18+
// Packages that cannot be auto-linked yet can be added manually here, for example:
19+
// add(MyReactNativePackage())
20+
},
21+
jsBundleFilePath = UpdateContext.getBundleUrl(this),
22+
)
23+
}
3724

3825
override fun onCreate() {
3926
super.onCreate()

0 commit comments

Comments
 (0)