Driversnote-Dev / react-native-kontaktio

React Native (iOS and Android) library for Kontakt.io beacons (and all other beacons)
MIT License
111 stars 48 forks source link

isConnected fails i connect() has not been called #15

Closed JonasWho closed 7 years ago

JonasWho commented 7 years ago

Since we have multiple places in our codebase where connect() can be called from, we would like a way to check whether or not the proximity manager has been initialised. I tried using isConnected(), but it throws an exception if called before connect().

Am I doing it wrong or should isConnected() also do a check for beaconProximityManager == null?

andrekovac commented 7 years ago

I fixed the issue on branch bug/isConnected-error. I just didn't have the right cable with me and couldn't test it. Perhaps you could give it a short test run and I'll then merge it to master.

JonasWho commented 7 years ago

Perfect, thanks! It works like a charm now :)