react-native-ibeacon icon indicating copy to clipboard operation
react-native-ibeacon copied to clipboard

Not Receiving DidEnter and DidExit

Open ghost opened this issue 10 years ago • 8 comments

I am not currently receiving these events - am I doing something wrong? Works just fine when I use ranging.

 var region = {
     identifier: 'myid.beacon.transmitter',
     uuid: 'f7826da6-4fa2-4e98-8024-bc5b71e0893e'    
 };

 Beacons.requestWhenInUseAuthorization();
 Beacons.startMonitoringForRegion(region);

 var subRegion = DeviceEventEmitter.addListener(
   'regionDidEnter',
   (data) => {
     console.log('!!!!! ---- |||| ==== !!!! ---- !!!=== !!!---');
     console.log('!!!!! ---- |||| ==== !!!! ---- !!!=== !!!---');
     console.log('!!!!! ---- |||| ==== !!!! ---- !!!=== !!!---');

     console.log('Region Did Enter!');
     console.log(data);

     console.log('!!!!! ---- |||| ==== !!!! ---- !!!=== !!!---');
     console.log('!!!!! ---- |||| ==== !!!! ---- !!!=== !!!---');
     console.log('!!!!! ---- |||| ==== !!!! ---- !!!=== !!!---');

   }
  );

ghost avatar Oct 26 '15 14:10 ghost

@bradynapier did you manage to solve this? I'm also stuck with monitoring events not being called.

tioback avatar Jun 25 '16 03:06 tioback

Does anyone knows if this is still a bug or something else needs to be done in order for these callbacks to work? I'm having the exact same issue.

leomar-developer avatar Nov 03 '16 21:11 leomar-developer

It worked once, but I cannot reproduce it.

tioback avatar Nov 03 '16 21:11 tioback

I can confirm it is NOT working in latest version (0.6.0), ranging beacons works fine though

leomar-developer avatar Nov 03 '16 21:11 leomar-developer

Can someone please shed some light on this one? I would really appreciate if someone can help out, we are using react 0.35.0 and a device with iOS 9. Ranging works fine but region monitoring seems to not be working we have tried a lot of variations on the code and "regionDidEnter" never gets called

leomar-developer avatar Nov 08 '16 22:11 leomar-developer

Just solved this one, I will describe what I did just in case it happens to be the same issue for the folks that also reported this above. The issue was that (for some strange reason) the popup dialog that asks the user to accept the usage of the background location was not coming up (even after properly adding the NSLocationAlwaysUsageDescription value on Info.plist), so I had to manually go to the app settings and tell it that the Location was needed "Always", after doing that and relaunching the app the events started to fire as expected.

leomar-developer avatar Nov 08 '16 22:11 leomar-developer

@leomar-developer, thanks! Did you try forcing the permissions popup to show?

tioback avatar Nov 11 '16 04:11 tioback

I have the same problem in that regionDidEnter and regionDidExit do not fire, actually, it's kind of flaky; sometimes the enter will fire sometimes not (mostly not). In my case, I verified that Location was set to Always and have also tried WhenInUse without changed. It seems that ranging works, and monitoring doesn't. I am using Estimote iBeacons.

react-native-cli: 1.2.0 react-native: 0.38.0 react-native-ibeacon: ^0.6.0

montehansen avatar Dec 05 '16 01:12 montehansen