Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. geofenceList!!.add(Geofence.Builder()
  2. // Set the request ID of the geofence. This is a string to identify this
  3. // geofence.
  4. .setRequestId(entry.key)
  5. .setLoiteringDelay(30000)
  6. // Set the circular region of this geofence.
  7. .setCircularRegion(
  8. entry.value.latLng!!.latitude,
  9. entry.value.latLng!!.longitude,
  10. entry.value.radius!!
  11. )
  12.  
  13. // Set the expiration duration of the geofence. This geofence gets automatically
  14. // removed after this period of time.
  15. .setExpirationDuration(1800000)
  16.  
  17. // Set the transition types of interest. Alerts are only generated for these
  18. // transition. We track entry and exit transitions in this sample.
  19. .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_ENTER or Geofence.GEOFENCE_TRANSITION_EXIT or Geofence.GEOFENCE_TRANSITION_DWELL)
  20.  
  21. // Create the geofence.
  22. .build())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement