logo
Video Call
On this page

Geofencing

2024-01-02

Feature Overview

Geofencing refers to limiting the transmission of audio, video, and signaling data to a certain 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 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 directly report an error.
  • Since there is cross-regional public internet between the specified geofencing region and the App user's region, poor public internet network quality will affect the audio and video experience.

Currently, the SDK supports the following regions:

Notes

If you need to support more regions, please contact ZEGOCLOUD Technical Support.

RegionEnum
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

Open geofencing permission

Geofencing capability may require payment in some cases. Please contact ZEGO business to confirm and open geofencing permission.

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 in the geofence.
    • Exclude: Indicates that all regions in the region list are excluded from the geofence.

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
ZegoGeoFenceType geofence_type = ZegoGeoFenceType.INCLUDE;//Set Include mode
List<Integer> geofence_area_list = new ArrayList<>(); // Set region list information, set at least 1, maximum set not greater than the number supported by the SDK
geofence_area_list.add(2);// ZegoGeoFenceAreaCode.CN
geofence_area_list.add(3);// ZegoGeoFenceAreaCode.NA
ZegoExpressEngine.setGeoFence(geofence_type, geofence_area_list);// This interface is a static method, called before createEngine

// Example of setting Exclude mode
ZegoGeoFenceType geofence_type = ZegoGeoFenceType.EXCLUDE;//Set Exclude mode
List<Integer> geofence_area_list = new ArrayList<>();// Set region list information, set at least 1, maximum set not greater than or equal to the number supported by the SDK
geofence_area_list.add(2);// ZegoGeoFenceAreaCode.CN
geofence_area_list.add(3);// ZegoGeoFenceAreaCode.NA
ZegoExpressEngine.setGeoFence(geofence_type, geofence_area_list);// This interface is a static method, called before createEngine

Integrate other features

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

Previous

Local Proxy

Next

Audio and Video Stream Encryption

On this page

Back to top