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

How are you thinking about region exits? #2

Open
Vramin opened this issue Jun 8, 2014 · 3 comments
Open

How are you thinking about region exits? #2

Vramin opened this issue Jun 8, 2014 · 3 comments

Comments

@Vramin
Copy link

Vramin commented Jun 8, 2014

I'm writing something to indicate when you have gone out of range of your beacon.

I've written my code so that it looks to see if the current set of watched ID's are found in the current set of detected ID's, so I can tell if one is missing for a while and raise an alert. While it seems to run fine if both apps are up (iPad is advertising a beacon, iPhone is detecting), when they go in the background I don't get any indication that the phone has moved out of range.

With regular iBeacon I could use a didExitRegion notification to respond to this scenario. Vicinity only seems to look for beacons to see if they are there, not to see if they are gone, so AltBeacon tends to replicate the same behavior. Have you considered any kind of didExit functionality? How would you approach it?

I'd be happy to take a run at it, but I'm pretty green at BLE and could use some guidance if you can provide it.

@marpal
Copy link
Contributor

marpal commented Jul 2, 2014

I haven't seen this problem. But I will look into it.

@Daij-Djan
Copy link

the basic code is: [all the region monitoring does anyways]


if(beaconWasNotVisibleLastTime && sameBeaconIsFoundThisTime)
    beaconDisappeared = 0;
    regionEntered

if(beaconWasVisibleLastTime && sameBeaconIsNotfoundThisTime)
    beaconDisappeared += 1;

if(beaconDisappeared >= 5)
    // not seen it 5 times, it is gone so:
    regionExit

@marpal
Copy link
Contributor

marpal commented Sep 23, 2014

I arrive to those results after some experiments.
But you are welcome to propose alternatives.

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

3 participants