Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29505

deviceNotReady error : "Registration failed" react-native-twilio-programmable-voice

$
0
0

I am working on react native application and want to integrate the Phone masking feature like Uber do. I have choosen Twilio Phone Masking for this. I have used react-native-twilio-programmable-voice package.

I have integrated this using this link:: https://medium.com/@edzh1/create-a-twilio-voip-calls-in-a-react-native-app-35a729a9613d

I have done server setup successfully, using php. But getting error deviceNotReady error : "Registration failed". I have no idea what I am doing wrong here.

This is initial function I am calling here::

initTwilio = async () => {    const token = await this.getAuthToken();    if (Platform.OS === 'android') {        await this.getMicrophonePermission();    }    const success = await TwilioVoice.initWithToken(token);    if (success.initialized) {        TwilioVoice.addEventListener('deviceReady', () => {            this.setState({ twilioInited: true });        });        TwilioVoice.addEventListener('deviceNotReady', function (data) {            console.log('data', data) // getting error here        });        if (Platform.OS === 'ios') { //required for ios            TwilioVoice.configureCallKit({                appName: 'ReactNativeTwilioExampleApp',            });        }    }};getAuthToken = () => {    return fetch('https://myurl/accessToken.php', {        method: 'get',    })    .then(response => response.text())    .catch((error) => console.error(error));}

Please help, and suggest me what I am doing wrong here.


Viewing all articles
Browse latest Browse all 29505

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>