Brandon Presley
514efc6467
This unfortunately has broken the unit tests. Will have to worry about fixing them later. Everything seems to be working other than that.
48 lines
1.6 KiB
Kotlin
48 lines
1.6 KiB
Kotlin
package com.massive
|
|
|
|
import android.app.Application
|
|
import com.facebook.react.PackageList
|
|
import com.facebook.react.ReactApplication
|
|
import com.facebook.react.ReactNativeHost
|
|
import com.facebook.react.ReactPackage
|
|
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
|
|
import com.facebook.react.defaults.DefaultReactNativeHost
|
|
import com.facebook.soloader.SoLoader
|
|
|
|
class MainApplication : Application(), ReactApplication {
|
|
private val mReactNativeHost: ReactNativeHost = object : DefaultReactNativeHost(this) {
|
|
override fun getUseDeveloperSupport(): Boolean {
|
|
return BuildConfig.DEBUG
|
|
}
|
|
|
|
override fun getPackages(): List<ReactPackage> {
|
|
val packages: MutableList<ReactPackage> = PackageList(this).packages
|
|
packages.add(MassivePackage())
|
|
return packages
|
|
}
|
|
|
|
override fun getJSMainModuleName(): String {
|
|
return "index"
|
|
}
|
|
|
|
override val isNewArchEnabled: Boolean
|
|
protected get() = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
|
|
override val isHermesEnabled: Boolean
|
|
protected get() = BuildConfig.IS_HERMES_ENABLED
|
|
}
|
|
|
|
override fun getReactNativeHost(): ReactNativeHost {
|
|
return mReactNativeHost
|
|
}
|
|
|
|
override fun onCreate() {
|
|
super.onCreate()
|
|
SoLoader.init(this, /* native exopackage */false)
|
|
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
|
// If you opted-in for the New Architecture, we load the native entry point for this app.
|
|
load()
|
|
}
|
|
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
|
|
}
|
|
}
|