Android Geofencing- only works when Google maps is running on ANY app
Asked Answered
V

0

9

I have implemented the android geofence code as per tutorial: https://www.raywenderlich.com/7372-geofencing-api-tutorial-for-android

A weird thing is that the geofence triggers only work when Google maps is running, on any app on device. When my app has launched, and then I go to home screen, location changes do not trigger geofence services. But if I open Google maps native app, and I change device location, then magically the background geofence service runs on my app.

Any thoughts? Is this maybe an Emulator issue?

Vladimir answered 26/2, 2020 at 4:14 Comment(7)
The reason for that is because Google completely blocked developers from accessing user locations directly. The one and only way it is done now is from pulling location information from Google Maps APIPollock
You can trigger google maps location update through your appPollock
Well in regard to triggering google maps inside my own app, the purpose of the geofence is to use it in background (when app is not running).Vladimir
I have the same problem. Did you solve it?Terminable
I did not. But ensure that your device is not in power saving mode, which might restrict background location updates.Vladimir
Same problem. Is there any solution or document to explain this case?Hagy
I am here in 2022 with exactly this issue, still.Elery

© 2022 - 2024 — McMap. All rights reserved.