Skip to content

Network Quality Events

Kenan Genjac edited this page May 10, 2023 · 1 revision

To provide better feedback during RTC calls with other users, you can subscribe to network quality events.

These events are used to inform the user of their local network quality. With such information, it is possible to determine when call quality is being affected by deteriorating network quality.

To use these events, one must set the NetworkQualityEventListener. This can be seen in the following example for a Call object:

let call = InfobipRTC.getActiveCall()
call.networkQualityEventListener = self

The examples of setting the NetworkQualityEventListener for ApplicationCall and RoomCall objects are the following:

let applicationCall = InfobipRTC.getActiveApplicationCall()
applicationCall.networkQualityEventListener = self
let roomCall = InfobipRTC.getActiveRoomCall()
roomCall.networkQualityEventListener = self

This event contains a NetworkQuality object which is an enum that describes the quality of the network in five levels ranging from bad to excellent. The numerical values of these enums are from 1 to 5, the latter being the best quality correlating to excellent.

It is worth noting that the network quality is highly dependent on your demands. A network that can have an excellent quality during a voice call might drop to fair quality while using video.

Tutorials

Migration guides

Reference documentation

Clone this wiki locally