GeoFence Device when app is in background

允我心安 提交于 2019-12-31 22:37:08

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/37565321/geofence-device-when-app-is-in-background

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!