1.0.0-beta.1 (March 10, 2023)
Twilio Voice React Native SDK is now in beta! Please see the following changes with this new release.
Additionally, we are also introducing the new Twilio Voice React Native Reference App as an example implementation of the Twilio Voice React Native SDK and serves to inspire developers who want to leverage the power of Twilio Programmable Voice in their React Native applications. Please see this page for more details.
Changes
- The integration testing app formerly under
example/has been renamed/moved totest/app/. - The React Native dependency within the integration testing app has been updated from
0.63.4to0.66.5.
API Changes
- The
voice.connectmethod now has the following function signatureNot passing an options object or leaving any member of the options object undefined will result in those options using default values.voice.connect(token: string, options?: Voice.ConnectOptions); interface Voice.ConnectOptions { contactHandle?: string; params?: Record<string, string>; }
See the API documentation for descriptions of options here.
Features
- The SDK now exports error classes and emits error objects specific to an error code. See the below code snippet for usage.
See the API Docs for all error classes.
import { TwilioErrors } from '@twilio/voice-react-native-sdk'; // ... voice.on(Voice.Event.Error, (error: TwilioErrors.TwilioError) => { if (error instanceof TwilioErrors.AuthorizationErrors.AccessTokenInvalid) { // Update your UI to reflect an invalid access token. } // Alternatively, your application logic can use the error code. if (error.code === 20101) { // Update your UI to reflect an invalid access token. } });
Fixes
- Fixed an issue where some types on the
CallandVoiceclasses were being incorrectly exported. Types and references toaddEventListenerare instead now correctly exported asaddListener. - Fixed an issue where available audio devices were sometimes incorrectly emitted and returned by the SDK on Android platforms. This occurs more frequently in development environments when the JS bundle is reloaded, but could happen in production environments as well.
- Fixed a warning that occurred on more recent versions of React Native when the SDK constructed a
NativeEventEmitter. - Fixed an issue where devices running Android 12+ encountered crashes when receiving an incoming call or making an outgoing call.