MrHertal / react-native-twilio-phone

Twilio Voice React Native module.
MIT License
154 stars 67 forks source link

Multiple incoming calls #50

Closed josaric closed 3 years ago

josaric commented 3 years ago

Hi, is it possible to register incoming calls for multiple Twilio accounts? I have two Twilio accounts and I want to enable receive calls from both numbers, but that means that:

RNTwilioPhone.initialize(callKeepOptions, this.fetchAccessToken);

should be initialised twice, once for each account with different access token.

MrHertal commented 3 years ago

Hi,

RNTwilioPhone was designed to use only one fetchAccessToken callback, as you can see here.

I have never tried to use two different Twilio accounts, so I don't know if it's possible. But I guess you will have to rewrite RNTwilioPhone class in order to implement your own logic and call the low level API method register twice.