Web SDK: API Events Changes

2019-06-06 15:12:34
63693
0

As of August 12, 2019, we will introduce some changes to the Web SDK to enhance its event handling. In most cases, these changes won’t affect how Web SDK operates, except for the workflow of the addEventListener/on interface.

WHAT NEEDS TO BE DONE

Our team have released a new version of the Web SDK on June 7, 2019. This version notifies developers about functions used incorrectly. Please check the production versions of your services in all browsers by using the developer console. In case of warning messages, you have up to 2 months to apply the necessary fixes, per the instructions below.

Changes with full backward compatibility

  1. The addEventListener/on interface will have three parameters (same as EventTarget):
    1. the event name
    2. an object implementing the EventListener interface (since this interface is based on a JS function, the backward compatibility is guaranteed)
    3. options objects – with the new release, once and capture will be supported:  
      1. once – removes a listener after the very first call
      2. capture – sets a listener first in the call stack
  2. The removeEventListener/off interface will also accept an object implementing the EventListener interface as the second argument
  3. Several fields and functions of a regular Event will be applied to all the events:
    1. ev.target will refer to the object that triggered the event (current fields will remain the same)
    2. ev.type will return the event's type (the name field will remain the same)
    3. ev.stopImmediatePropagation() prevents other listeners of the same event from being called

Changes that are not backward compatible

A new version of the Web SDK will consider the value returned by the user’s handler. If it’s false, further callback processing will be stopped.

Example:

call.on(VoxImplant.CallEvents.Connected,(e)=>{
  console.log(‘First callback’);
  return false;
})
call.on(VoxImplant.CallEvents.Connected,(e)=>{
  console.log(‘Second callback’);
})

The current version of the Web SDK will print the following:

> First callback

> Second callback

The output of the new version will be:

> First callback
Sign Up for a free Voximplant developer account or talk to our experts

Add your comment

Name*
Email*
Message

Your comment has been added and will be published after moderation.

Recommended posts

Where CPaaS Deploy their Networks - a Comparison

Where CPaaS Deploy their Networks - a Comparison

A couple weeks ago, Amazon Web Services (AWS) experienced an outage in its US-EAST-1 region. As so many services rely on AWS, this outage had a broader impact, causing outages and various issues with Amazon’s own Ring services, online retailers, and even the New York City MTA. In addition, a couple major Communications Platform as a Service (CPaaS) providers also reported issues (Voximplant was not impacted), potentially impacting the communications of many of their customers.  With this in mind, now is a good time to look at how CPaaS offers leverage public cloud infrastructure and review the factors involved in providing reliable, high quality communications services. In this post we will review the public cloud infrastructure used by several major CPaaS vendors and discuss the implications of their choices.

Personalized Service 101: What it is and How to Deliver it

Personalized Service 101: What it is and How to Deliver it

For many consumers, personalized customer service is key to good customer experiences (CX). According to a 2020 survey by Gladly, close to two-thirds of respondents said that “lack of personalization makes [them] feel like a ticket number.” Businesses wishing to meet and exceed customer expectations need to make personalized service a top priority. But personalization goes beyond making movie recommendations or using a customer’s name in an email subject line. When it comes to personalized service, it’s paramount that you deliver relevant, valuable, and speedy support to promote positive customer experiences. In this article, we’ll break down what personalized service means, why it’s so important to CX, and how you can deliver personalization service to your customers.

What is a No-code Contact Center?

What is a No-code Contact Center?

If you’re involved in evaluating cloud contact center services, you’ve likely recognized two distinct categories and a big difference in the amount of technical expertise required to implement them. You’re attracted to the ease of use offered by contact center as service (CCaaS) offerings, but their fixed functionality doesn’t fit your business needs. In contrast, a cloud contact center built on a communications platform as a service (CPaaS) offering provides unlimited flexibility, but requires expensive software development resources to build a complete solution.