Add the #DF24 Developer Keynote to your agenda. Join us in-person on 9/18 at 2:30 p.m. PT or on Salesforce+ at 5 p.m. PT for the must-see session built just for developers.

startMonitoringGeofence()

Start monitoring a geofence region.

  • geofence—(Required) A Geofence object to monitor.

A Promise object that resolves as a string value. The value is a unique ID that’s assigned to the monitored geofence. If there’s an error, a rejected promise returns the error type of GeofenceServiceFailure.

Use this function to start monitoring of a geofence. 

Your callback function is called to return the ID of the geofence that’s been created. To stop monitoring the geofence in the future, retain the geofence ID.