Skip to contentSkip to navigationSkip to topbar
On this page

Voice React Native SDK Changelog



1.2.1 (Oct 31, 2024)

121-oct-31-2024 page anchor

Features

features page anchor

Platform Specific Features

platform-specific-features page anchor
Android
android page anchor
  • Fixed crash issue where system restarts service without an Intent (intent == null).

1.2.0 (Sep 16, 2024)

120-sep-16-2024 page anchor

Call Message Events (GA)

call-message-events-ga page anchor

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 31209 to 31212.

  • The behavior of call.sendMessage has been changed to support future contentTypes. Please see the API Docs(link takes you to an external page) for more information.

Platform Specific Changes

platform-specific-changes page anchor
  • Now pulling version 6.6.2 of the Twilio Voice Android SDK.
  • Now pulling version 6.11.2 of the Twilio Voice iOS SDK.

1.1.1 (Aug 28, 2024)

111-aug-28-2024 page anchor
  • Bumped minSdkVersion to 23 to 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, and bytesReceived.


1.1.0 (Aug 20, 2024)

110-aug-20-2024 page anchor
  • Added support for Android 34.

  • The SDK now gracefully handles missing microphone permissions on the Android platform. When using the JavaScript API, callInvite.accept() and voice.connect() will now reject with error PermissionsError and code 31401. When accepting an incoming call through the native notification, you can catch the analogous 31401 error by attaching a listener to voice.on(Voice.Event.Error, ...). See the following example:

    1
    voice.on(Voice.Event.Error, (error) => {
    2
    // handle error
    3
    if (error.code === 31401) {
    4
    // show the end-user that they did not give the app the proper permissions
    5
    }
    6
    });
  • Resolved an issue where Call Messages were not being constructed with the specified contentType or messageType.

  • Resolved an issue where some OutgoingCallMessage.Event.Failure events were not being raised due to a race condition.

Call Message Events (Beta)

call-message-events-beta page anchor
  • (Breaking) Removed CallMessage.MessageType and CallMessage.ContentType enumerations and types. These types have been replaced by string.

  • (Breaking) Simplified the Call and CallInvite APIs for sending call messages. Call.sendMessage and CallInvite.sendMessage now 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:

1
const call = await voice.connect(...);
2
const outgoingCallMessage = await call.sendMessage({
3
content: { foo: 'bar' },
4
contentType: 'application/json',
5
messageType: 'user-defined-message',
6
});

For call invites:

1
voice.on(Voice.Event.CallInvite, (callInvite) => {
2
const outgoingCallMessage = await callInvite.sendMessage({
3
content: { foo: 'bar' },
4
contentType: 'application/json',
5
messageType: 'user-defined-message',
6
});
7
});
  • Added new error codes. See the following table for details:
    Error CodeDescription
    31210Raised when a Call Message is sent with an invalid message type.
    31211Raised 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.

1.0.0 (Mar 25, 2024)

100-mar-25-2024 page anchor

Twilio Voice React Native SDK has now reached milestone 1.0.0 and is Generally Available (GA). Included in this version are the following.

Call Message Events (Beta)

call-message-events-beta-1 page anchor
  • Allow sending and receiving "user-defined" messages during an ongoing Voice Call and during a pending Call Invite.
  • To send a CallMessage, and handle sent and failure cases:
1
const message = new CallMessage({
2
content: { key1: 'This is a message from the parent call' },
3
contentType: CallMessage.ContentType.ApplicationJson,
4
messageType: CallMessage.MessageType.UserDefinedMessage
5
});
6
const outgoingCallMessage: OutgoingCallMessage = await call.sendMessage(message);
7
8
outgoingCallMessage.addListener(OutgoingCallMessage.Event.Failure, (error) => {
9
// outgoingCallMessage failed, handle error
10
});
11
12
outgoingCallMessage.addListener(OutgoingCallMessage.Event.Sent, () => {
13
// outgoingCallMessage sent
14
});
  • To receive a CallMessage:
1
call.addListener(Call.Event.MessageReceived, (message: CallMessage) => {
2
// callMessage received
3
});
  • See related Voice SDK Call Message Events docs here.
  • Fixed and improved the docstrings for the Voice and Call listeners. 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(link takes you to an external page) for details. The method call.getInitialConnectedTimestamp() now returns a Date object.

    1
    const call = voice.connect(...);
    2
    const date = call.getInitialConnectedTimestamp();
    3
    const millisecondsSinceEpoch = date.getTime();
  • The API for Call Invite events has now changed.

    The following events have been moved from the Voice class to the CallInvite class:

    • Voice#callInviteAccepted is now CallInvite#accepted
    • Voice#callInviteRejected is now CallInvite#rejected
    • Voice#callInviteNotificationTapped is now CallInvite#notificationTapped
    • Voice#cancelledCallInvite is now CallInvite#cancelled

    Please see the Voice class API documentation here(link takes you to an external page) for details.

    Please see the CallInvite class API documentation here(link takes you to an external page) 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_icon for incoming call notifications
    • answered_call_small_icon for answered call notifications
    • outgoing_call_small_icon for 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_text for incoming call notifications
    • outgoing_call_caller_name_text for outgoing call notifications
    • answered_call_caller_name_text for answered call notifications
      • NOTE: For incoming_call_caller_name_text and answered_call_caller_name_text, the substring ${from} will be replaced with the caller and for outgoing_call_caller_name_text, the substring ${to} will be replaced with the recipient of the call (if available, defaulting to "unknown").
  • Custom functionality around the displayName TwiML parameter has been removed.

    In previous versions of the SDK, passing a custom TwiML parameter displayName would 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.

1.0.0-beta.4 (Jan 11, 2024)

100-beta4-jan-11-2024 page anchor

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 CustomParameters type to Record<string, string> instead of Record<string, any>.
  • Fixed inconsistency with AudioDevice typings, preferring undefined over null for optional values.
  • Fixed an issue with call.isMuted() and call.isOnHold() APIs. They should now always return boolean \| undefined instead of potentially returning null.
  • Fixed an issue with call.getFrom(), call.getTo(), and call.getSid() APIs. They should now always return string \| undefined instead of potentially returning null.
  • 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 registered and unregistered events 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. Please Note that these changes require changes to the application integrating the SDK. For more information, please refer to the Beta.4 migration guide(link takes you to an external page).

1.0.0-beta.3 (August 26, 2023)

100-beta3-august-26-2023 page anchor

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(link takes you to an external 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.CallInviteNotificationTapped for 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. Earpiece instead of earpiece.
  • Fixed return value of Call.mute and Call.hold to return the new mute/hold value. Thanks to our community (@treycucco with PR #164) for this addition!
  • IncomingCallService now specifies foreground service type MICROPHONE on API >= 30 devices. This fixes issues with microphone access for backgrounded apps. Note that this change also resulted in the compiled SDK version being bumped to 33 from 29.

1.0.0-beta.2 (June 23, 2023)

100-beta2-june-23-2023 page anchor

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, the Call objects will now have the proper state.
  • Calls will now persist a timestamp (milliseconds since epoch) of when they initially receive the Call.Event.Connected event. See Call.getInitialConnectedTimestamp.

1.0.0-beta.1 (March 10, 2023)

100-beta1-march-10-2023 page anchor

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(link takes you to an external page) for more details.

  • The integration testing app formerly under example/ has been renamed/moved to test/app/.
  • The React Native dependency within the integration testing app has been updated from 0.63.4 to 0.66.5.

The voice.connect method now has the following function signature

1
voice.connect(token: string, options?: Voice.ConnectOptions);
2
3
interface Voice.ConnectOptions {
4
contactHandle?: string;
5
params?: 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(link takes you to an external page).

The SDK now exports error classes and emits error objects specific to an error code. See the below code snippet for usage.

1
import { TwilioErrors } from '@twilio/voice-react-native-sdk';
2
// ...
3
voice.on(Voice.Event.Error, (error: TwilioErrors.TwilioError) => {
4
if (error instanceof TwilioErrors.AuthorizationErrors.AccessTokenInvalid) {
5
// Update your UI to reflect an invalid access token.
6
}
7
8
// Alternatively, your application logic can use the error code.
9
10
if (error.code === 20101) {
11
// Update your UI to reflect an invalid access token.
12
}
13
});

See the API Docs(link takes you to an external page) for all error classes.

  • Fixed an issue where some types on the Call and Voice classes were being incorrectly exported. Types and references to addEventListener are instead now correctly exported as addListener.
  • 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.

1.0.0-preview.1 (September 1, 2022)

100-preview1-september-1-2022 page anchor

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.