Skip to content

Instantly share code, notes, and snippets.

@tmodoux
Created April 22, 2024 07:58
Show Gist options
  • Save tmodoux/7e3cb52524efc6553ac172b907c5896c to your computer and use it in GitHub Desktop.
Save tmodoux/7e3cb52524efc6553ac172b907c5896c to your computer and use it in GitHub Desktop.
MainReactNativeHost kotlin code for twilio voice sdk integration in android app built with React native
package com.androidapp
import android.app.Application
import com.facebook.react.PackageList
import com.facebook.react.ReactPackage
import com.twiliovoicereactnative.VoiceApplicationProxy
class MainReactNativeHost(application: Application) : VoiceApplicationProxy.VoiceReactNativeHost(application) {
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
override fun getPackages(): List<ReactPackage> {
val packages = PackageList(this).packages
// Packages that cannot be autolinked yet can be added manually here
// packages.add(MyReactNativePackage())
return packages
}
override fun getJSMainModuleName(): String = "index"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment