動的にダウンロードした (オンデマンドの動的配信モジュール) android モジュールを、react native のネイティブ モジュールに追加する必要があります。これはどのように達成できますか?
class RnPackage : ReactPackage {
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
return arrayListOf(ReactVideoPlayerManager())
}
override fun createNativeModules(
reactContext: ReactApplicationContext): List<NativeModule> {
val modules = ArrayList<NativeModule>()
modules.add(RnBridge(reactContext))
//need to add on demand module here (once the download is complete)
return modules
}
}