Open leocavalcante opened 5 years ago
The same issue. I've setuped simple geofence environment with broadcast and enable High accuracy but in background mode my broadcast doesn't invoked by system
I've being struggling for 2 days on geofence and mean documentation ... I found that it works on real device and doesn't work on emulator
I'm already testing on a real device, but it doesn't work for me.
In my opinion, Google geofence API has unreliable behaviors. The same code works sometimes and doesn't work sometimes.
developing for android is the worst experience of my life.
@leocavalcante what device are you running it on ? I have been battling geofencing for longer than I would like to admit now, but I did have a little breakthrough today:
Huawei
, SDK version 28 and geofences are not triggeredpixel 4
today (sdk 29) and everything worked. Setup pretty much the same as found here: https://www.raywenderlich.com/7372-geofencing-api-tutorial-for-android. No background service needed, and things run smoothly and without any problem, in any constelation: foreground, background, or the app has been force-quit >> the geofences are triggered.Sony
(sdk 24) and again, everything worked as intended.Consider however taking a walk around with your device, rather than testing it on emulator. I have never got it to run on my emulator, regardless of it's setup, but the moment I went out with my device, things worked just fine.
I will come back with an edit when I figure out why nothing works on my Huawei. I've yet to confirm it on the oneplus device.
Google's Geofencing sometimes works, sometimes it does not. It depends on your hardware, location, speed and 1000s of other factors. This is why commercial sdk arises, let me link to just one of them. They may work better or worse, it's hard to say as long as their code is close-sourced.
I followed the steps at https://developer.android.com/training/location/geofencing, but nothing happens (no logs from the BrodcastReceiver). Just download and installed the Geofencing example here and no logs either. Some ideas of what I could be doing wrong? Location permissions are granted.