| Class Info |
|---|
| public class GeofenceService Geofence location class, which is used for interaction during location. An instance of this class will be returned when the getGeofenceService(Activity activity) or getGeofenceService(Context context) method in the LocationServices class is called. |
| Qualifier and Type | Method Name and Description |
|---|---|
| Task<Void> | createGeofenceList(GeofenceRequest geofenceRequest, PendingIntent pendingIntent) Adds geofences through PendingIntent. When a geofence is triggered, a notification will be broadcasted. |
| Task<Void> | deleteGeofenceList(List<String> geofenceRequestIds) Deletes geofences based on their creation request IDs. |
| Task<Void> | deleteGeofenceList(PendingIntent pendingIntent) Deletes geofences through PendingIntents passed for creating these geofences. |
| Method |
|---|
| public Task<Void> createGeofenceList(GeofenceRequest geofenceRequest, PendingIntent pendingIntent) Adds geofences through PendingIntent. When a geofence is triggered, a notification will be broadcasted. |
Parameters
| Name | Description |
|---|---|
| geofenceRequest | Geofence request object. |
| pendingIntent | PendingIntent associated with each geofence request. When building a PendingIntent object, you need to set Class and Action. Do not build an empty intent. |
Returns
| Type | Description |
|---|---|
| Task<Void> | Task execution result. You can add the onComplete(Task task) callback to receive the adding result. If task.isSuccessful() returns true, the geofences are added successfully. Otherwise, the geofences fail to be added. |
Your app needs to redeliver the geofence in scenarios listed below:
| Method |
|---|
| public Task<Void> deleteGeofenceList(List<String> geofenceRequestIds) Deletes geofences based on their request IDs. |
Parameters
| Name | Description |
|---|---|
| geofenceRequestIds | Request IDs of geofences to be removed. |
Returns
| Type | Description |
|---|---|
| Task<Void> | Task execution result. You can add the onComplete(Task task) callback to receive the removal result. If task.isSuccessful() returns true, the geofences are removed successfully. Otherwise, the geofences fail to be removed. |
| Method |
|---|
| public Task<Void> deleteGeofenceList(PendingIntent pendingIntent) Deletes geofences through PendingIntents passed for creating these geofences. |
Parameters
| Name | Description |
|---|---|
| pendingIntent | PendingIntent associated with geofences to be removed. |
Returns
| Type | Description |
|---|---|
| Task<Void> | Task execution result. You can add the onComplete(Task task) callback to receive the removal result. If task.isSuccessful() returns true, the geofences are removed successfully. Otherwise, the geofences fail to be removed. |