Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OnRegionStateChanged - never get executed #5

Open
walnut-co opened this issue Aug 16, 2018 · 6 comments
Open

OnRegionStateChanged - never get executed #5

walnut-co opened this issue Aug 16, 2018 · 6 comments

Comments

@walnut-co
Copy link

walnut-co commented Aug 16, 2018

OnRegionStateChanged never gets executed ? and OnLocationChanged get called repeatedly.

and any plans for sample ?

@walnut-co walnut-co changed the title What is the unit of measure for the radius? OnRegionStateChanged - never get executed Aug 16, 2018
@willsam100
Copy link

I had the same problem and found that it only occurred when I was targetting Android 8.0 or higher. When I rolled the target back to Android 7.0 then OnRegionStateChanged started working again (even running on an Android 8 device).

This is a short-term fix though, as Google is not accepting new apps that target Android 7.0 and current apps have until the end of the year (2018) to update.

@manzha
Copy link

manzha commented Sep 13, 2018

I had the same problem and found that it only occurred when I was targetting Android 8.0 or higher. When I rolled the target back to Android 7.0 then OnRegionStateChanged started working again (even running on an Android 8 device).

This is a short-term fix though, as Google is not accepting new apps that target Android 7.0 and current apps have until the end of the year (2018) to update.

I tried this fix but it only results in OnLocationChanged being called repeatedly and OnRegionStateChanged only being called once at the very start of the app. I can't make it work :(

Isn't there any project sample?

@HeroXx
Copy link

HeroXx commented Oct 14, 2018

I am also having this issue, any help?

@manzha
Copy link

manzha commented Oct 15, 2018

I am not sure if the problem was because I was debugging using a physical device and an application for mocking locations, as for android API 26, this technique (mocking locations in device) is not working correctly with some apps (it constantly jumped from original location to mock location). I became aware of this days laters (too late as I was using a different approach to my problem).

So my advice would be to try debug it while walking in real time, and not using mockup locations (at least for android, not sure ios).

@patkozlowski
Copy link

patkozlowski commented Nov 10, 2018

Any ETA on fixing this for Android 8.0 and above? I’m noticing this same exact behavior. I have an app in production that heavily uses this.

@patkozlowski
Copy link

patkozlowski commented Jan 24, 2019

I had to modify the API to get this to work with my specific use case. This does work for Android 8 and above, but I had to start the service as a foreground service, or else you will get some illegal state exception due to android 8 background service limitations, maybe that could be implemented into the project in the future. I've also noticed that builder.SetInitialTrigger(GeofencingRequest.InitialTriggerDwell) worked for me as I want to be notified when starting the geofence, after the dwelling time for the user to be notified. You can set based upon your specific use case to use the defaulted InitialTriggerEnter or even builder.SetInitialTrigger(GeofencingRequest.InitialTriggerDwell | GeofeningRequest.InitialTriggerEnter). I use on a real device and test using an app called "Fake GPS" which works pretty well of mocking and changing locations for testing.

For iOS you can follow this youtube video for spoofing your gps on the real device. The workflow I use is to have the app already loaded on your phone (you can't debug though, as you will be running the blank "gps spoofer app" in xcode). Change the coordinates in the black app, and see the gps changes reflected in the app using the geofencing api.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants