Driversnote-Dev / react-native-kontaktio

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

simulate a beacon detected #44

Open pashute opened 6 years ago

pashute commented 6 years ago

Could you add a feature to simulate a detected beacon (or a few), and also give a mock of the data received in answer to detected beacons? I need this for my ios app which is crashing when a beacon is detected, and I'm sure there are many developers who could use this.

Or perhaps there's a way to do this that you can tell me?

A regular beacon simulator emitting a simulated beacon is not enough because the Kontakt-io outputs an extra internal field with the kontakt id.

andrekovac commented 6 years ago

Such a virtual beacon would be a great thing. It would also be very useful for unit tests so that the beacon response could be mocked. However I didn't think about how to realize it yet. If you have an idea I'd be very happy about a PR!

pashute commented 6 years ago

You have the code to read a real beacon when ondeviceconnected or something like that. You have the data received and you emit an event or callback in response. No? All that's left is to debug and catch the event.

בתאריך יום ב׳, 26 בנוב׳ 2018, 12:50, מאת André Kovac < notifications@github.com>:

Such a virtual beacon would be a great thing. It would also be very useful for unit tests so that the beacon response could be mocked. However I didn't think about how to realize it yet. If you have an idea I'd be very happy about a PR!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Artirigo/react-native-kontaktio/issues/44#issuecomment-441597208, or mute the thread https://github.com/notifications/unsubscribe-auth/ABsSM9okv2IpwP5SxiDGc5cQy3yrOzIJks5uy8dogaJpZM4Yn3-v .

pashute commented 6 years ago

And fill it with fake data.

בתאריך יום ב׳, 26 בנוב׳ 2018, 16:30, מאת Moshe Flam pashute@gmail.com:

You have the code to read a real beacon when ondeviceconnected or something like that. You have the data received and you emit an event or callback in response. No? All that's left is to debug and catch the event.

בתאריך יום ב׳, 26 בנוב׳ 2018, 12:50, מאת André Kovac < notifications@github.com>:

Such a virtual beacon would be a great thing. It would also be very useful for unit tests so that the beacon response could be mocked. However I didn't think about how to realize it yet. If you have an idea I'd be very happy about a PR!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Artirigo/react-native-kontaktio/issues/44#issuecomment-441597208, or mute the thread https://github.com/notifications/unsubscribe-auth/ABsSM9okv2IpwP5SxiDGc5cQy3yrOzIJks5uy8dogaJpZM4Yn3-v .