Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GeoFence Device when app is in background

I have implemented the geoFence api and everything is working good. But there are some problems, I want more clarification regarding my confusions.

Here are some of the confusions and problems:

  1. I want my user to get notified when he enters a geofenced area. I have implemented the GeofenceTransitionsIntentService as per guideline but it is not triggering the transition when the app is in background. What should I need to do?

  2. GeoFence Expire time: it is pretty obvious that if we enter Never it is not going to expire, but I am confused about the time. For example if I set it to 10 minutes, what does that exactly do? Will the geofence expire after the given time since it is created or it would expire when the user arrives at that place and then the timer would start? How can we get the geofence to expire when the user gets there.

  3. How is Google tracking us? How does the geofence actually work? We are not sending our location, then now it is tracking ? Does it start tracking us when we add a geofence and then notify us when arrived at that place?

Please tell me and discuss about these confusions, especially my confusion about it working while the app is closed or destroyed.

like image 433
Coas Mckey Avatar asked Jun 01 '16 09:06

Coas Mckey


1 Answers

About 1.) According to this Google I/O Talk When you're using PendingIntents the Location API should wake up your app even if it's runnning in the background, although from my experience the Geofencing events are quite unreliable, but this might be related to a bad GPS receiver in the device I used for testing.

like image 146
apidae Avatar answered Oct 01 '22 20:10

apidae