我想在android上设置自定义捆绑包网址。这个主题有question。但是自定义ReactNativeHost不适用于调试模式(该应用尚未发布)。我该怎么办?
public class MainApplication extends Application implements ReactApplication {
public final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage()
);
}
@Override
protected String getJSMainModuleName() {
return "index";
}
@Override
@Nullable
protected String getJSBundleFile() {
return "sdcard/.../index.android.bundle";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}