mmazzarolo / react-native-beacons-android

A React-Native library for detecting beacons on Android
MIT License
74 stars 15 forks source link

When trying to use "Beacons.detectIBeacons()" getting error undefined is not an object (evaluating 'beaconsAndroid.addParser') #18

Closed SonalRewri closed 8 years ago

SonalRewri commented 8 years ago

I checked the link also - react-native link rnpm-install info Android module react-native-beacons-android is already linked

Any other thing i can check.

mmazzarolo commented 8 years ago

Why did you already closed the issue? 😄
However I'm feeling it must be related to #14, did you already check it?
What version of React-Native are you using?

mmazzarolo commented 8 years ago

I just tested it, if you're on RN >= 0.30 you must link the project using react-native link and it will link react-native-android-beacons correctly.

I'm closing the issue but feel free to comment here 👍

SonalRewri commented 8 years ago

Thanks for the reply, the issue got solved. The RN version is react-native: 0.31.0.

I am facing another problem in detecting the beacons, the error is - "CycledLeScanner: No Bluetooth adapter. beaconService cannot scan.." Any help is greatly appreciated. I am using Estimote beacons.

I am new one is RN and android development.

mmazzarolo commented 8 years ago

No worries. That error sounds weird, are you using an emulator/virtual device?

SonalRewri commented 8 years ago

Yes I am using Android emulator . Is it something related to this. Because when I am using my phone android 4.3 then on real device it's giving me error that batchedBridge is not bundled.

affibox commented 8 years ago

C:\Users\jcbar\Desktop\affibox\reactnative\RuralKing\node_modules\react-native\Libraries\JavaScript…:61 Cannot read property 'addParser' of undefined

olegdeezus commented 8 years ago

Have same error

mmazzarolo commented 8 years ago

Please follow these steps and let me know the results 👍

olegdeezus commented 8 years ago

I just added

import com.mmazzarolo.beaconsandroid.BeaconsAndroidPackage;

and

 new BeaconsAndroidPackage()

to my MainApplication.java and it solved issue. Reinstalling or using react-native link did not help.

mmazzarolo commented 8 years ago

@olegdizus On which version of React-Native?
It worked for me on both RN0.30 and RN0.31

olegdeezus commented 8 years ago

@mmazzarolo react-native 0.29.0

mmazzarolo commented 8 years ago

Ah, that version seems to have some problem with linking...

olegdeezus commented 8 years ago

At RN 0.31.0 linking works pretty well. Thanks for help!

mmazzarolo commented 8 years ago

No worries, have fun 👍