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

enteredRegion event not fired. #30

Open
morefun0302 opened this issue Feb 17, 2015 · 5 comments
Open

enteredRegion event not fired. #30

morefun0302 opened this issue Feb 17, 2015 · 5 comments

Comments

@morefun0302
Copy link

I am using the below code as stated in your example:

TiBeacons.startMonitoringForRegion({
uuid : "E2C56DB5-DFFB-48D2-B060-D0F5A71096E0",
major : 1,
minor : 4,
identifier : "Shop A"
});

but the enteredRegion event is not fired, however, determinedRegionState can be fired.

Please help, thanks

@jbeuckm
Copy link
Owner

jbeuckm commented Feb 18, 2015

Are you leaving the region to start your app? If your app starts within the region, you will not receive enteredRegion.

@davemuir
Copy link

I have found this to be an issue as well. It seems to be a little random. Sometimes the beacon is OUTSIDE and other times it's INSIDE upon monitoring beacons. If it starts inside, I don't see event happening unless the beacon is powered off/on or ranged out. Are you planning on fixing this issue in a later release, work arounds?

Thanks

@avines002
Copy link

I'm seeing this happen as well. I'm thinking monitoring for determinedRegionState==inside might be a good work around?

@h3r2on
Copy link

h3r2on commented May 1, 2015

since you can get the regionState it's trivial to add code similar to this

var beaconsInRange = [];  //array to hold deacons currently being monitored
var beacons = [] //array of beacons info

function regionState(e) {
  Ti.API.info(e);
  if(e.regionState == "inside") {
    if(!_.contains(beaconsInRange, e.identifier)) {
      var beacon = _.findWhere(beacons, {identifier: e.identifier});
      beaconsInRange.push(e.identifier);
      TiBeacons.startRangingForBeacons(beacon);
    }
  }
}

@achimhoth
Copy link

In my setup not even determinedRegionState is firing reliably. Seems to only fire once. I do get traces from the module though telling whether I enter or exit a region. Maybe the events are not bubbling up to the Titanium level?

bildschirmfoto 2015-12-02 um 09 01 38

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

6 participants