目录

Introduction to Geofencing

A geofence is a location-based technology that allows you to define specific geographic areas. When a user enters, exits, or dwells within a geofenced area, the corresponding geofence event (entry, exit, or dwell) can be reported to the app. The app can then perform the corresponding service logic upon receiving the event, for example, to notify the user.

HarmonyOS supports two types of geofences: on-device geofences and cloud geofences. For on-device geofences, developers manage the geofence lifecycle, including creating and deleting geofences. For cloud geofences, developers directly use public geofences provided by Huawei's cloud service. On-device geofences are suitable for scenarios that require custom geofences, whereas cloud geofences are suitable for scenarios that use public geofences.