domaven / xamarin-plugins

Cross platform Xamarin & Windows plugins for PCLs
MIT License
37 stars 51 forks source link

[Geofence] Exit event will be invoked twice in the latest version #11

Closed xinmeng1 closed 6 years ago

xinmeng1 commented 8 years ago

I encounter one problem when using the latest version. That is the Exit event will be invoked twice. It means that Enter the region occur one time, however the Exited the region occur 2 times. I have try the sample which use the 1.0.4 without this problem. However I update the plugin to 1.1.1, the problem occurred again in the Sample. I think it is a bug maybe.

Test Case: Using iOS Emulator

Set the location as the custom location:

La: 51.625742 Lo: -0.7424

Open the Sample App

Add the fence at current location and radius is 10

Then choose the City Run in the Location emulator.

There will be two notifications for Exited geofence region.

skitch

jfversluis commented 8 years ago

+1 but not just twice. It seems to fire randomly at other places as well. Enter event is just being fired once.

klingu commented 8 years ago

I have 2 issues/bugs for your plugin: which I can not explain after analysing your sample app and my own app.

1: double exitnotifications on exiting geofence. 2: On add geofence, and GPS location is outside of the added geofence. exitnotification is shown.

AD 1 I run the sample app and my own app with the same version of your Geofence plugin (1.1.2) This issue is also on version (1.1.1).

I've added 2 locations in the sample app... (Start) and (kruis1) When entering these regions, the EnterRegionMessage appears once for each region. When exiting these regions, the ExitRegionMessage appears just once for each region.

In my own application, I've added 1 location (Koningskade 4) On entering this region, the EnterRegionMessage appears just once. On exiting this region, the ExitRegionMessage appears twice. simulator screen shot 08 jul 2016 14 13 01

AD2 When I add a location via an Async Task, just like the same way you do, in my own app: I immediately get the notification I've exited the geofence.

When adding a location on the sample app, it does not show any ExitRegionMessage at all.

I'm willing to share my Solution with you.

Like to hear from you soon,

Jeffrey

rdelrosario commented 8 years ago

Hi guys

I'm aware of this issues, just don't have the time to look at them. PR are welcome if you guys want to look into the code and fix.