Voice React Native SDK Changelog
- You can now perform a
PreflightTestto help evaluate the quality of calls made on a device ahead of time. See the PreflightTest documentation to learn more.
- Updated the Twilio Voice iOS SDK version to
6.13.3. This update fixes a Bluetooth device type deprecation warning when building with Xcode 26.
- The call contact handle template feature now caches the set value. This fixes an issue where the handle template value would be
nullwhen an incoming call was received and the React Native JS runtime was not initialized or was restarted by the OS.
- Added Bluetooth permissions to the Twilio Voice RN SDK manifest.
- Updated Audioswitch library to version
1.2.2. This should fix missing Bluetooth audio devices on Android platforms.
-
Added support for React Native applications using the New Architecture. If you are migrating your app from the Old Architecture to the New Architecture, and are already using the Twilio Voice React Native SDK, you will need to adjust your
MainApplication.javafile. Please see the updated Getting Started docs for Java or Kotlin.- If you are encountering this error:
java.lang.IllegalArgumentException: You can call getDefaultReactHost only with instances of DefaultReactNativeHostwhen attempting to use this SDK with a NewArch application, please update your application logic in accordance with our updated Android Getting Started guides as linked above.
- If you are encountering this error:
- Updated the RNModule methods to invoke all Voice Service API methods from only the main thread.
- Updated the Twilio Voice Android SDK dependency to
6.7.1.
- Updated the Twilio Voice iOS SDK dependency to
6.12.1.
- Added a new API for customizing the displayed name for incoming calls in CallKit on iOS.
See
voice.setIncomingCallContactHandleTemplateand the associated API docs for more information. - Added a new API for customizing the displayed name for outgoing, incoming, and answered call notifications on Android.
See
voice.setIncomingCallContactHandleTemplateandvoice.connectfor more information.
- Fixed a scenario where posting feedback for a call with the
Echoissue would not post correctly to Twilio Insights.
- Added opt-out functionality for the built-in Firebase Messaging service. Please see this document for more details.
- Fixed crash issue where system restarts service without an Intent (
intent == null).
The Call Message Events feature in the Twilio Voice React Native SDK, previously released in 1.0.0 as Beta, is promoted to Generally Available (GA).
- (Breaking) The error code for attempting to send a call message with a payload size exceeding maximum limits has changed from
31209to31212. - The behavior of
call.sendMessagehas been changed to support futurecontentTypes. Please see the API Docs for more information.
- Now pulling version
6.6.2of the Twilio Voice Android SDK.
- Now pulling version
6.11.2of the Twilio Voice iOS SDK.
- Bumped
minSdkVersionto23to match the latest versions of React Native.
- Fixed crash issue on API 34 when activity is not running in background or foreground and an incoming call is received.
- Fixed some RTCStats members not available on Android. Specifically,
mos,bytesSent, andbytesReceived.
- Added support for Android 34.
- The SDK now gracefully handles missing microphone permissions on the Android platform.
When using the JavaScript API,
callInvite.accept()andvoice.connect()will now reject with errorPermissionsErrorand code31401. When accepting an incoming call through the native notification, you can catch the analogous31401error by attaching a listener tovoice.on(Voice.Event.Error, ...). See the following example:1voice.on(Voice.Event.Error, (error) => {2// handle error3if (error.code === 31401) {4// show the end-user that they did not give the app the proper permissions5}6});
- Resolved an issue where Call Messages were not being constructed with the specified
contentTypeormessageType. - Resolved an issue where some
OutgoingCallMessage.Event.Failureevents were not being raised due to a race condition.
- (Breaking) Removed
CallMessage.MessageTypeandCallMessage.ContentTypeenumerations and types. These types have been replaced bystring. - (Breaking) Simplified the
CallandCallInviteAPIs for sending call messages.Call.sendMessageandCallInvite.sendMessagenow take a plain-JS object, or interface, as a parameter.
The following is an example of the updated API considering the above changes.
For outgoing calls:
1const call = await voice.connect(...);2const outgoingCallMessage = await call.sendMessage({3content: { foo: 'bar' },4contentType: 'application/json',5messageType: 'user-defined-message',6});
For call invites:
1voice.on(Voice.Event.CallInvite, (callInvite) => {2const outgoingCallMessage = await callInvite.sendMessage({3content: { foo: "bar" },4contentType: "application/json",5messageType: "user-defined-message",6});7});
- Added new error codes. See the following table for details:
Error Code Description 31210 Raised when a Call Message is sent with an invalid message type. 31211 Raised when attempting to send a Call Message before the Call/CallInvite is ready to send messages. This can typically happen when the Call/CallInvite is not yet in a ringing state.
Twilio Voice React Native SDK has now reached milestone 1.0.0 and is Generally
Available (GA). Included in this version are the following.
- Allow sending and receiving "user-defined" messages during an ongoing Voice Call and during a pending Call Invite.
- To send a CallMessage, and handle
sentandfailurecases:
1const message = new CallMessage({2content: { key1: "This is a message from the parent call" },3contentType: CallMessage.ContentType.ApplicationJson,4messageType: CallMessage.MessageType.UserDefinedMessage,5});6const outgoingCallMessage: OutgoingCallMessage = await call.sendMessage(7message8);910outgoingCallMessage.addListener(OutgoingCallMessage.Event.Failure, (error) => {11// outgoingCallMessage failed, handle error12});1314outgoingCallMessage.addListener(OutgoingCallMessage.Event.Sent, () => {15// outgoingCallMessage sent16});
- To
receivea CallMessage:
1call.addListener(Call.Event.MessageReceived, (message: CallMessage) => {2// callMessage received3});
- See related Voice SDK Call Message Events docs here.
- Fixed and improved the docstrings for the
VoiceandCalllisteners. The descriptions of the events and listeners should now point to the correct docstrings. - Call quality warning events should now properly pass arguments to listener functions.
-
The API for
call.getInitialConnectedTimestamp()has now changed. Please see the API documentation here for details. The methodcall.getInitialConnectedTimestamp()now returns aDateobject.1const call = voice.connect(...);2const date = call.getInitialConnectedTimestamp();3const millisecondsSinceEpoch = date.getTime(); -
The API for Call Invite events has now changed.
The following events have been moved from the
Voiceclass to theCallInviteclass:Voice#callInviteAcceptedis nowCallInvite#acceptedVoice#callInviteRejectedis nowCallInvite#rejectedVoice#callInviteNotificationTappedis nowCallInvite#notificationTappedVoice#cancelledCallInviteis nowCallInvite#cancelled
Please see the
Voiceclass API documentation here for details.Please see the
CallInviteclass API documentation here for details. -
Call Notifications can be customized on Android.
The following features regarding a call notification can now be modified:
- Incoming/outgoing/answered call notification tray icon
- Name of caller or recipient
The incoming/outgoing/answered call notification tray icon can be changed by adding a drawable resource with the following id to your application:
incoming_call_small_iconfor incoming call notificationsanswered_call_small_iconfor answered call notificationsoutgoing_call_small_iconfor outgoing call notifications
The name of the caller or recipient of a call in the notification can be set by adding the following string resources with the following ids to your application:
incoming_call_caller_name_textfor incoming call notificationsoutgoing_call_caller_name_textfor outgoing call notificationsanswered_call_caller_name_textfor answered call notifications- NOTE: For
incoming_call_caller_name_textandanswered_call_caller_name_text, the substring${from}will be replaced with the caller and foroutgoing_call_caller_name_text, the substring${to}will be replaced with the recipient of the call (if available, defaulting to "unknown").
- NOTE: For
-
Custom functionality around the
displayNameTwiML parameter has been removed.In previous versions of the SDK, passing a custom TwiML parameter
displayNamewould override the notification on Android platforms. Now, this functionality has been removed and notification customization is handled with the above features.
- Call timestamp now in simplified ISO-8601 format, not stored as a double from epoch.
- Uses system provided notification styles for incoming and outgoing calls. This ensures visual consistency between devices.
- Fixed issue where call records were not being removed after call was ended.
- The call connected timestamp is now in simplified ISO-8601 format.
- A new method
CallInvite.updateCallerHandle()has been added. Use this method to update the caller's name displayed in the iOS system incoming call UI. This method is specific to iOS and unavailable in Android.
Twilio Voice React Native SDK has now reached milestone beta.4. Included in this version are the following.
- Fixed an issue with exported types. Typescript language server hinting should now properly prioritize the narrower, more helpful, event-emitter types.
- Narrowed the
CustomParameterstype toRecord<string, string>instead ofRecord<string, any>. - Fixed inconsistency with
AudioDevicetypings, preferringundefinedovernullfor optional values. - Fixed an issue with
call.isMuted()andcall.isOnHold()APIs. They should now always returnboolean \| undefinedinstead of potentially returningnull. - Fixed an issue with
call.getFrom(),call.getTo(), andcall.getSid()APIs. They should now always returnstring \| undefinedinstead of potentially returningnull.
- Fixed a bug where the call invite results in a rejected event when the call is hung up by the caller.
- Fixed a bug where the
registeredandunregisteredevents are not fired on iOS. - Fixed an issue where timestamps emitted by the iOS layer were in the wrong units (seconds instead of milliseconds).
- Replace Frontline notification images with generic phone images
- In call notifications now display when accepting a call from JS application
- Audio routing for incoming and outgoing calls are now correctly routed
- Internal simplification of call accepted/rejected intent message paths
- Refactored internals & added permissions for Bluetooth and notifications. Note: These changes require changes to the application integrating the SDK. For more information, please refer to the Beta.4 migration guide.*
Twilio Voice React Native SDK has now reached milestone beta.3. Included in this version are the following.
- Added documentation about outgoing call ringback tones.
- Added more call info persistence. The native layers will now persist call state and initial connected timestamps.
-
Applications can now choose to use their own iOS PushKit implementation or delegate the incoming call handling to the SDK's default handler by calling the
Voice.initializePushRegistry()method, referred henceforth as the "SDK PushKit handler".Note that when not using the "SDK PushKit handler", applications will need to notify the SDK upon receiving PushKit device token updates so the SDK can perform registration properly. Applications will also need to notify the SDK upon receiving push notifications so the SDK can report incoming calls to the iOS CallKit framework properly. See this page for more details.
- Incoming call notifications can now be tapped to bring the application into the foreground.
- Tapping on an incoming call notification will emit an event.
See
Voice.Event.CallInviteNotificationTappedfor more information. - Use latest versions of Twilio Voice Android SDK and the Audioswitch libraries.
- Fixed a bug where switching from Bluetooth to the iOS earpiece during a call does not have any effect or error.
- Fixed an issue where audio device types were incorrectly labeled using capitalized descriptions. I.e.
Earpieceinstead ofearpiece. - Fixed return value of
Call.muteandCall.holdto return the new mute/hold value. Thanks to our community (@treycucco with PR #164) for this addition!
IncomingCallServicenow specifies foreground service type MICROPHONE onAPI >= 30devices. This fixes issues with microphone access for backgrounded apps. Note that this change also resulted in the compiled SDK version being bumped to33from29.
Twilio Voice React Native SDK has now reached milestone beta.2. Included in this version are the following.
- Pinned to a specific version of the Twilio Voice iOS SDK. This fixes issues with some builds failing on iOS platforms.
- Fixed the Intent flags on Android platforms. This fixes issues with the application crashing on newer versions of Android.
- Calls will now persist their state through JS runtimes. Now, if the React Native JS layer encounters a restart, and if your code performs
Voice.getCalls, theCallobjects will now have the proper state.
- Calls will now persist a timestamp (milliseconds since epoch) of when they initially receive the
Call.Event.Connectedevent. SeeCall.getInitialConnectedTimestamp.
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.
- 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.
The voice.connect method now has the following function signature
1voice.connect(token: string, options?: Voice.ConnectOptions);23interface Voice.ConnectOptions {4contactHandle?: string;5params?: Record<string, string>;6}
Not passing an options object or leaving any member of the options object undefined will result in those options using default values. See the API documentation for descriptions of options here.
The SDK now exports error classes and emits error objects specific to an error code. See the below code snippet for usage.
1import { TwilioErrors } from "@twilio/voice-react-native-sdk";2// ...3voice.on(Voice.Event.Error, (error: TwilioErrors.TwilioError) => {4if (error instanceof TwilioErrors.AuthorizationErrors.AccessTokenInvalid) {5// Update your UI to reflect an invalid access token.6}78// Alternatively, your application logic can use the error code.910if (error.code === 20101) {11// Update your UI to reflect an invalid access token.12}13});
See the API Docs for all error classes.
- 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.
- This is the initial preview release of Twilio Voice React Native SDK. Please check out the README for more details.