react-native-peripheral
react-native-peripheral copied to clipboard
Advertising two different services sequentially
Hello,
We are trying to advertise two different data with a certain delay, our intended workflow looks like this:
- Create a characteristic and a service
- Start advertising
- Stop advertising after 10 seconds
- Remove previously added service
- Create another characteristic and service
- Start advertising again but with different name
- Stop after 10 seconds again
However, the receiver device receives the old service with the old name. While we are searching for a solution online, we found that it may be caused by the bluetooth cache of the devices. Currently, we do not know if it is due to the cache of the advertising device or the receiver device. Assuming that we have the ability to refresh the cache within the capabilities of React Native, is it possible to implement a workflow such as the above one?
Upon different trials, I believe we discovered that Peripheral.stopAdvertising() does not work because even after we close the application, our receiver device keeps receiving the data while the advertising device's bluetooth is enabled.
@trkdgnr did you ever find a solution?
I do agree, there should be some triggers for this situation. However having the broadcasts continue after backgrounding the app and closing the app are wonderful. That said, upon returning to the app (which is still advertising) checking that status results in a "false: value