react-native-beacons-manager icon indicating copy to clipboard operation
react-native-beacons-manager copied to clipboard

iOS monitoring example doesn't work ranging works fine

Open stocksp opened this issue 8 years ago • 11 comments

Version

1.0.7

RN version 49.3

Platform

iOS

OS version

iOS 11

Steps to reproduce

  1. Create default RN project
  2. Paste in monitoring.ios.js, fix up imports, add correct uuid and name, add plist entries
  3. run on ipad with some beacons laying around

Expected behavior

should see 'regionDidEnter' callback

Actual behavior

No beacons seen. The ranging example works fine. Beacons pop right up I see my exact issue was opened and closed 4 days ago #49 by @prem315, not sure what happened. Its really just a default app with the monitoring.ios.js example code with an updated plist which is here . I added the extra plist entry as xcode told me my app would not run without it.

<key>NSLocationWhenInUseUsageDescription</key>
<string>When in use description here</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Always and when in use Location description here</string>

stocksp avatar Oct 11 '17 05:10 stocksp

I've also been experiencing issues. I found that when I quit the app and reloaded it, the beacons would not trigger an entry event, but would then trigger an exit event after which all ranging worked fine. Are you able to reproduce this?

eurobob avatar Oct 13 '17 05:10 eurobob

Have the same issue. Not able to monitor beacons at all. Tried on Android and it works, but on iOS they just don't show up. Ranging works fine.

react-native-beacons-manager version: 1.0.7 react-native version: 0.52.0 iOS: 11.2.2

andreassavva avatar Jan 11 '18 13:01 andreassavva

Run into the same issue. Work fine on Android but not on iOS. Please help.

HoangTrung avatar Feb 27 '18 04:02 HoangTrung

Try to add all 3 keys in info.plist, Privacy - Location Always and When In Use Usage Description, Privacy - Location Always Usage Description and Privacy - Location When In Use Usage Description and also use Beacons.requestAlwaysAuthorization(). That's when the popup worked for me and the notifications have worked.

andreassavva avatar Feb 27 '18 12:02 andreassavva

I have the same issue. I tried adding those three keys to .plist but still not getting any events triggering. I replaced Beacons.BeaconsEventEmitter.addListener by DeviceEventEmitter.addListener because of this error: TypeError: undefined is not an object (evaluating '_reactNativeBeaconsManager2.default.BeaconsEventEmitter.addListener

Then the app worked but it never triggers the regionDidEnter nor the regionDidExit

React-native: 0.53.3 React-native-beacons-manager version: 1.0.7 IOS: 11.2.5

Using this exact example https://github.com/MacKentoch/react-native-beacons-manager/blob/master/examples/samples/monitoring.ios.js

julioarhernandez avatar Feb 28 '18 07:02 julioarhernandez

same problem here (only tested on iOS right now)

react-native-beacons-manager version: 1.0.7 react-native version: 0.50.4 iOS: 11.3

regionDidEnter and regionDidExit events are never fired. i have LOT of plist privacy authorizations :)

How can we help to fix the issue ?

Victor

vmacavero avatar Apr 10 '18 05:04 vmacavero

Just tested with example and it still works fine.

So I guess it is time to update the example version so that I will be able to give you more feedback.

By the way: when monitoring, don't forget that if you are already in beacon region when starting monitoring it won't trigger enter event.

My way to test:

  • I use a software beacon simulator
  • beacon is off
  • I start iOS Demo app
  • I turn on beacon
  • it works: enter event is thrown

This is a native limitation not specific to library.

MacKentoch avatar Apr 10 '18 08:04 MacKentoch

hi @MacKentoch i'm doing the exact same thing (i'm usingmactsasbeacon -> https://github.com/timd/MactsAsBeacon here on gihtub )

  • I turn mactsasbeacon off (UUID is the same as my code, triple checked ;) )
  • i run my app on a real device via xcode app starts, beacon searching (monitorin) starts
  • i turn on mactsasbeacon, nothing happens

Anyway, just to double check some facts :

  1. Version 1.10 is no more, there's only the 1.07 available , right ?
  2. The example code is not correct, we should subsitute Beacons.BeaconsEventEmitter with DeviceEventEmitter ? (importing DeviceEventEmitter from {react-native} ) or there's another way ?

Thanks.

Victor

vmacavero avatar Apr 11 '18 07:04 vmacavero

The example code is correct for 1.1.0 which is ongoing now. Currently, the release version is 1.0.7 (via npm or yarn). According to this changelog : https://github.com/MacKentoch/react-native-beacons-manager/blob/master/CHANGELOG.md //before 1.0.8 (or until 1.0.7): DeviceEventEmitter.addListener() // simply becomes (for both iOS and Android) Beacons.BeaconsEventEmitter.addListener()

xinyuwang avatar Jun 25 '18 18:06 xinyuwang

I got this issue and i think the problem was that i had first requested

requestWhenInUseAuthorization

in a earlier version of my app then when i changed it to requestAlwaysAuthorization the old auth got stuck in the dev phone some how.

So try to delete the dev app and build it again. Go in to Settings > integrity > Location services. and make sure your app is listed as Allways

maxxafari avatar Aug 16 '18 07:08 maxxafari

No progress on this one? I'm having the same issues on iOS. RangingBeacons works fine, Monitoring not working at all.

Gillinghammer avatar Dec 16 '18 13:12 Gillinghammer