logo
On this page

Geofencing

2024-01-02

Overview

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

Specified geofencing regionApp user regionActual SDK access regionUser experience after connection
EuropeEuropeEuropeNormal
EuropeChinaEuropeMay be significantly affected
Caution
  • If all servers in the specified geofencing region are unavailable, the SDK will directly report an error.
  • Since there is cross-regional public internet between the specified geofencing region and the region where App users are located, poor public internet network quality will affect the audio and video experience.

Currently the SDK supports configuring the following regions:

Note

For support for more regions, please contact ZEGOCLOUD Technical Support.

RegionEnumeration
Mainland China, excluding Hong Kong, Macao, and TaiwanCN
North AmericaNA
IndiaIN
EuropeEU
Asia, excluding Mainland China and IndiaAS

Prerequisites

Before using the geofencing feature, please ensure:

Implementation Process

Activate geofencing permission

Geofencing capability may require payment in some cases. Please contact ZEGO business personnel to confirm and activate 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 apply to 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.

Caution

Please configure geofencing information before calling createEngineWithProfile, otherwise it will be invalid.

// Example of setting Include mode
var geofence_type = ZegoGeoFenceType.Include;// Set Include mode
var geofence_area_list = <int>[]; // Set region list information, set at least 1, at most not greater than the number supported by the SDK
geofence_area_list.add(ZegoGeoFenceAreaCode.CN);// ZegoGeoFenceAreaCode.CN
geofence_area_list.add(ZegoGeoFenceAreaCode.NA);// ZegoGeoFenceAreaCode.NA
ZegoExpressEngine.setGeoFence(geofence_type, geofence_area_list);// This interface is a static method, called before createEngineWithProfile

// Example of setting Exclude mode
var geofence_type = ZegoGeoFenceType.Exclude;// Set Exclude mode
var geofence_area_list = <int>[];// Set region list information, set at least 1, at most not greater than or equal to the number supported by the SDK
geofence_area_list.add(ZegoGeoFenceAreaCode.CN);// ZegoGeoFenceAreaCode.CN
geofence_area_list.add(ZegoGeoFenceAreaCode.NA);// ZegoGeoFenceAreaCode.NA
ZegoExpressEngine.setGeoFence(geofence_type, geofence_area_list);// This interface is a static method, called before createEngineWithProfile

Integrate other features

After completing the geofencing settings, you can proceed with integrating other features.

Previous

Cloud Proxy

Next

Audio and Video Stream Encryption

On this page

Back to top