1.0.0 (Mar 25, 2024)
Twilio Voice React Native SDK has now reached milestone 1.0.0 and is Generally
Available (GA). Included in this version are the following.
Features
Call Message Events (Beta)
- 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:
const message = new CallMessage({
content: { key1: 'This is a messsage from the parent call' },
contentType: CallMessage.ContentType.ApplicationJson,
messageType: CallMessage.MessageType.UserDefinedMessage
});
const outgoingCallMessage: OutgoingCallMessage = await call.sendMessage(message);
outgoingCallMessage.addListener(OutgoingCallMessage.Event.Failure, (error) => {
// outgoingCallMessage failed, handle error
});
outgoingCallMessage.addListener(OutgoingCallMessage.Event.Sent, () => {
// outgoingCallMessage sent
});- To
receivea CallMessage:
call.addListener(Call.Event.MessageReceived, (message: CallMessage) => {
// callMessage received
});Fixes
- 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.
Changes
-
The API for
call.getInitialConnectedTimestamp()has now changed.
Please see the API documentation here for details.
The methodcall.getInitialConnectedTimestamp()now returns aDateobject.const call = voice.connect(...); const date = call.getInitialConnectedTimestamp(); const 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 notificaiton 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 resources 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: Forincoming_call_caller_name_text&answered_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").
-
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.
Platform Specific Changes
Android
- Call timestamp now in simplified ISO-8601 format, not stored as a double from epoch.
- Uses system provided notification styles for incoming & ongoing calls. This insures visual consistency between devices.
- Fixed issue where call records were not being removed after call was ended.
iOS
- 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.