npm @twilio/voice-react-native-sdk 1.0.0

latest releases: 1.8.1, 1.8.0, 1.8.0-rc2...
2 years ago

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 sent and failure cases:
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 receive a CallMessage:
call.addListener(Call.Event.MessageReceived, (message: CallMessage) => {
  // callMessage received
});

Fixes

  • 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.

Changes

  • The API for call.getInitialConnectedTimestamp() has now changed.
    Please see the API documentation here for details.
    The method call.getInitialConnectedTimestamp() now returns a Date object.

    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 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 for details.

    Please see the CallInvite class 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_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 & 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.

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.

Don't miss a new voice-react-native-sdk release

NewReleases is sending notifications on new releases.