Closed thekundankamal closed 3 years ago
Hello, @thekundankamal I am also trying to work with this package,I just want to know. did it work correctly on both ios/android and also about while broad casting what is "uuid" and "MANUF_DATA", .I want my app to act as beacon and also I have to transmit custom payload.can you guide me on this?
@kirantripathi Yes it's working on both platforms but only on the foreground state not in the background state. And for custom payload, you can only send the advertising data with some length limitation.
@thekundankamal In which field were you be able to send custom payload.
Folks, background processing has been severely limited by both Android and iOS in the latest months. iOS will kill any process that is running. Android is easier, but it can also kill the process. On Android, you have to register a service to start the adv and scanning there.
Try using the https://www.npmjs.com/package/react-native-background-fetch to register the services and run Scheduled tasks that activate both scanning and advertising.
@vitorpamplona I have tried it but it's not working for me but now I have created custom for android. which is running in the background and also now I am able to send longer data in advertisement.
@kirantripathi
In that library, you can only send the data MANUF_DATA
BLEAdvertiser.broadcast(udid,MANUF_DATA,{
But you cannot send the longer data in it.
@thekundankamal can you share your approach , as I also need to achieve something like that.
@kirantripathi https://github.com/theappbusiness/Tracy Use the above library for this one you need to only send the data from native to code react native with headlessjs of maybe another approach. Currently, I am using HeadlesJs for android.
I have used headless.js for the background but I am not getting any scan device callback. Advertisement and scan request is working but not getting any device.