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 meet regional data privacy and security related 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 the App user's region, the region actually accessed by the SDK will be Europe.

Specified Geofencing RegionApp User's RegionSDK Actually Accessed 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 cause the audio and video experience to be affected.

Currently, the SDK supports configuring the following regions:

Note

If you need to support more regions, please contact ZEGO 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 Flow

1 Enable geofencing permission

Geofencing capability requires charging in some cases. Please contact ZEGO sales to confirm and enable geofencing permission.

2 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 all regions in the region list are included within the geofencing.
    • Exclude: Indicates 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 createEngineWithProfile, otherwise it will be invalid.

// Example of setting Include mode
ZegoGeoFenceType geo_fence_type = ZEGO_GEO_FENCE_TYPE_INCLUDE;//Set Include mode
NSMutableArray<NSNumber*> *geo_fence_area = [[NSMutableArray alloc] init]; // Set region list information, at least 1 must be set, at most not greater than the number supported by the SDK
[geo_fence_area addObject:ZEGO_GEO_FENCE_AREA_CODE_CN];
[geo_fence_area addObject:ZEGO_GEO_FENCE_AREA_CODE_NA];
[ZegoExpressEngine setGeoFence:geo_fence_type area:geo_fence_area];// This interface is a static method, called before createEngineWithProfile

// Example of setting Exclude mode
ZegoGeoFenceType geo_fence_type = ZEGO_GEO_FENCE_TYPE_EXCLUDE;//Set Exclude mode
NSMutableArray<NSNumber*> *geo_fence_area = [[NSMutableArray alloc] init];// Set region list information, at least 1 must be set, at most not greater than or equal to the number supported by the SDK
[geo_fence_area addObject:ZEGO_GEO_FENCE_AREA_CODE_CN];
[geo_fence_area addObject:ZEGO_GEO_FENCE_AREA_CODE_NA];
[ZegoExpressEngine setGeoFence:geo_fence_type area:geo_fence_area];// This interface is a static method, called before createEngineWithProfile

3 Integrate other features

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

Previous

Local Proxy

Next

Audio and Video Stream Encryption

On this page

Back to top