logo
Video Call
On this page

Geofencing

2024-01-02

Feature 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 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 regionActual region accessed by SDKUser experience after connection
EuropeEuropeEuropeNormal
EuropeChinaEuropeMay be significantly affected
Warning
  • If all servers in the specified geofencing region are unavailable, the SDK will directly report an error.
  • Due to the cross-region public internet between the specified geofencing region and the App user's region, poor public internet quality will affect the audio and video experience.

The currently supported regions for SDK configuration are as follows:

Notes

If you need 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, ensure that:

Implementation Flow

Enable Geofencing Permission

Geofencing capability may require payment 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 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.

Warning

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

// Example of setting Include mode
//Set Include mode
ZegoGeoFenceType  type = ZegoGeoFenceType::ZEGO_GEO_FENCE_TYPE_INCLUDE;
// Set region list information, at least 1, at most not more than the number supported by the SDK
std::vector<int> areaList;
areaList.push_back((int)ZegoGeoFenceAreaCode::ZEGO_GEO_FENCE_AREA_CODE_CN);
areaList.push_back((int)ZegoGeoFenceAreaCode::ZEGO_GEO_FENCE_AREA_CODE_NA);
// This interface is a static method, called before createEngine
ZegoExpressSDK::setGeoFence(type, areaList);

// Example of setting Exclude mode
//Set Exclude mode
ZegoGeoFenceType  type = ZegoGeoFenceType::ZEGO_GEO_FENCE_TYPE_EXCLUDE;

// Set region list information, at least 1, at most not more than the number supported by the SDK
std::vector<int> areaList;
areaList.push_back((int)ZegoGeoFenceAreaCode::ZEGO_GEO_FENCE_AREA_CODE_CN);
areaList.push_back((int)ZegoGeoFenceAreaCode::ZEGO_GEO_FENCE_AREA_CODE_NA);
// This interface is a static method, called before createEngine
ZegoExpressSDK::setGeoFence(type, areaList);

Integrate Other Features

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

Previous

Cloud Proxy

Next

Security Encryption

On this page

Back to top