Wenn ich anrufe:
Code: Select all
Voice.connect(...)
Code: Select all
java.lang.NullPointerException
at java.util.Objects.requireNonNull (Objects.java:233)
at com.twiliovoicereactnative.VoiceApplicationProxy.getMainActivityClass (VoiceApplicationProxy.java:122)
at com.twiliovoicereactnative.NotificationUtility.createOutgoingCallNotificationWithLowImportance (NotificationUtility.java:231)
at com.twiliovoicereactnative.VoiceService.raiseOutgoingCallNotification (VoiceService.java:316)
Abhängigkeiten
- React Native: 0.79.x (Expo Prebuild)
- Expo SDK: ~53.0.22
- Twilio Voice SDK (Android):
Code: Select all
com.twilio:voice-android:6.3.0 - auch getestet mit 6.2.1
Code: Select all
@twilio/voice-react-native-sdk[*]Gerät: iQOO Neo 10
[*]Android-Version: 15
[*]Architektur: Neue Architektur aktiviert (Fabric + TurboModules)
Code: Select all
MainActivity.ktCode: Select all
class MainActivity : ReactActivity() {
private val activityProxy = VoiceActivityProxy(
this
) { permission: String -\>
when (permission) {
Manifest.permission.RECORD_AUDIO -\> {
Toast.makeText(
this@MainActivity,
"Microphone permissions needed. Please allow in your application settings.",
Toast.LENGTH_LONG
).show()
}
Manifest.permission.BLUETOOTH_CONNECT -\> {
if (Build.VERSION.SDK_INT \>= Build.VERSION_CODES.S) {
Toast.makeText(
this@MainActivity,
"Bluetooth permissions needed. Please allow in your application settings.",
Toast.LENGTH_LONG
).show()
}
}
Manifest.permission.POST_NOTIFICATIONS -\> {
if (Build.VERSION.SDK_INT \> Build.VERSION_CODES.S_V2) {
Toast.makeText(
this@MainActivity,
"Notification permissions needed. Please allow in your application settings.",
Toast.LENGTH_LONG
).show()
}
}
}
}
override fun onCreate(savedInstanceState: Bundle?) {
setTheme(R.style.AppTheme)
super.onCreate(null)
}
override fun getMainComponentName(): String = "main"
override fun createReactActivityDelegate(): ReactActivityDelegate {
return ReactActivityDelegateWrapper(
this,
BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,
object : DefaultReactActivityDelegate(
this,
mainComponentName,
fabricEnabled
) {}
)
}
override fun invokeDefaultOnBackPressed() {
if (Build.VERSION.SDK_INT \
Mobile version