logo
Video Call
On this page

Geofencing

2024-01-02

Feature Introduction

Geofencing refers to limiting audio, video, and signaling data transmission to a specific region to comply with regional data privacy and security regulations, which is to limit access to Video Call services in a specific region. For example, when the specified geofencing region is Europe, regardless of where the App users are located, the region actually accessed by the SDK will be Europe.

Specified geofencing regionApp user regionSDK actual access regionUser experience after connection
EuropeEuropeEuropeNormal
EuropeChinaEuropeMay be significantly affected
Warning
  • If all servers in the specified geofencing region are unavailable, the SDK will report an error directly.
  • Due to the cross-region public internet between the specified geofencing region and the App user region, poor public internet network quality will affect the Video Call experience.

The current SDK supports the following region configurations:

Note
If you need to support more regions, please contact ZEGO technical support.
RegionEnumValue
China Mainland, excluding Hong Kong, Macao, and TaiwanCN2
North AmericaNA3
EuropeEU4
Asia, excluding China Mainland and IndiaAS5
IndiaIN6

Prerequisites

Before using the geofencing feature, please ensure:

Implementation Flow

Enable Geofencing Permission

Geofencing capabilities require fees in some cases. Please contact ZEGO sales to confirm and enable geofencing permissions.

Set Geofencing

  • Geofencing information: includes geofencing type and geofencing region list.
  • Geofencing type: includes two types, Include and Exclude. The geofencing type will act on the geofencing region list.
    • Include: indicates that all regions in the region list are included within the geofencing.
    • Exclude: indicates that all regions in the region list are excluded from the geofencing.

Before creating the SDK, call the setGeoFence interface to set geofencing information.

Warning

Please configure geofencing information before creating the ZegoExpressEngine engine instance, otherwise it will be invalid.

// Example of setting Include mode
const geofenceType = 1;// Set Include mode
const geofenceAreaList = [2,4]; // Set region list information, at least 1 must be set, maximum cannot exceed the number supported by the SDK
ZegoExpressEngine.setGeoFence(geofenceType, geofenceAreaList);// This interface is a static method, called before new ZegoExpressEngine

// Example of setting Exclude mode
const geofenceType = 2;// Set Exclude mode
const geofenceAreaList = [2,4];// Set region list information, at least 1 must be set, maximum cannot be greater than or equal to the number supported by the SDK
ZegoExpressEngine.setGeoFence(geofenceType, geofenceAreaList);// This interface is a static method, called before new ZegoExpressEngine

Integrate Other Features

After completing the geofencing settings, you can proceed with other feature integration.

Previous

Cloud Proxy

Next

Audio and Video Track Replacement

On this page

Back to top