Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any listener like 'TwilioVoice.addEventListener('deviceReady') not working in IOS #218

Open
skjangid opened this issue Jul 28, 2022 · 6 comments

Comments

@skjangid
Copy link

Hello,

I am using react-native-twilio-programmable-voice for making a phone call, this is working fine in android but not working in IOS.

TwilioVoice.initWithToken is return true and after that i calling listeners but linterners alr noe calling in ios.

My code is :

import TwilioVoice from 'react-native-twilio-programmable-voice';

useEffect(() => {
initTwilio()
}, [])

const initTwilio = async () => {
    const tokenUrl = await getAuthUrlToken();
    const token = await getAuthToken(tokenUrl.twilio.json_access_token_url);
    await getMicrophonePermission();
    const resp = await TwilioVoice.initWithToken(token && token.token && token.token.toString());
    console.log('resp init token', resp);
    listeners();
    if (Platform.OS === 'ios') { //required for ios
        try {
          TwilioVoice.configureCallKit({
              appName: 'Materio',                  // Required param
          });
          console.log('CallKit Configured');
      } catch (err) {
        console.err('call kit error', err);
      }
    }
};

const listeners = () => {
console.log('listeners');
TwilioVoice.addEventListener('deviceReady', () => {
console.log('ready')
});

    TwilioVoice.addEventListener('deviceNotReady', function (data) {
        console.log('data', data)
    })

    TwilioVoice.addEventListener('connectionDidDisconnect', (data) => {
        console.log('>> TwilioVoice, Call disconnect.', data);
    });

    TwilioVoice.addEventListener('connectionDidConnect', function (data) {
        setCallState('Connected')
    })

    TwilioVoice.addEventListener('connectionIsReconnecting', function (data) {
        console.log('connectionIsReconnecting', data)
    })

    TwilioVoice.addEventListener('connectionDidReconnect', function (data) {
        console.log('connectionDidReconnect', data)
    })

    TwilioVoice.addEventListener('callStateRinging', function (data) {
        console.log('callStateRinging', data)
    })
    TwilioVoice.addEventListener('callInviteCancelled', function (data) {
        console.log('callInviteCancelled', data)
     })

    TwilioVoice.addEventListener('deviceDidReceiveIncoming', function (data) {
        console.log('deviceDidReceiveIncoming', data)
    })

}

@skjangid
Copy link
Author

skjangid commented Aug 2, 2022

Hello, You guys have any update for me ?

@prerakd
Copy link

prerakd commented Aug 25, 2022

Facing the same issue for [email protected]

@saif482
Copy link

saif482 commented Aug 31, 2022

@prerakd is it fixed for you?

@Nziranziza
Copy link

Having similar issue as well

@janandaraj
Copy link

+1 same issue

@culov
Copy link

culov commented Apr 24, 2023

Same issue. Was working for years for me, but no longer works on iOS after upgrading to Xcode 14. Is this package dead now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants