Я пытаюсь включить Twilio Voice, используя пакет React-Cniate-Twilio-программируемого голоса. My app loads on ios, but when running on android I get this error message
Attempt to invoke virtual method 'boolean
android.app.Activity.shouldShowRequestPermissionRationale' on a null
object reference
screenshot here
I've included in AndroidManifest.xml
and none of the TwilioVoice related functions are called until 4 or 5 screens into the app.
Been scratching my head for Несколько дней, любая помощь очень ценится.import TwilioVoice from 'react-native-twilio-programmable-voice';
import {Platform} from 'react-native';
import config from '../config/Config';
export default class Voip{
constructor(props) {
this.state = {
};
}
async setupDeviceWithToken(accessToken){
console.log('V32: setup device', accessToken);
TwilioVoice.addEventListener('deviceReady', () => this.deviceReadyHandler());
TwilioVoice.addEventListener('deviceNotReady', () => this.deviceNotReadyHandler());
TwilioVoice.addEventListener('connectionDidConnect', () => this.connectionDidConnectHandler());
TwilioVoice.addEventListener('connectionDidDisconnect', () => this.connectionDidDisconnectHandler());
if(Platform.OS === 'ios')
{
TwilioVoice.addEventListener('callRejected', this.callRejected());
} else if (Platform.OS === 'android')
{
TwilioVoice.addEventListener('deviceDidReceiveIncoming', this.deviceDidReceiveIncomingHandler());
}
var success;
try {
success = await TwilioVoice.initWithToken(accessToken);
console.log('V36: ', success);
//return success;
}
catch(err){
console.log('V40: ' ,err);
return err;
}
// if(Platform.OS === 'ios')
// {
try {
TwilioVoice.configureCallKit({
appName: 'VoipApp' // Required param
})
console.log('V50: ios success');
//return 'success';
}
catch (err) {
console.log('V54: ',err);
return err;
}
// }
return success;
}
Подробнее здесь: https://stackoverflow.com/questions/464 ... howdshowre