A React native BLE Advertiser
npm install tp-rn-ble-advertiser
Advertise given message using BLE
---
``sh`
npm install tp-rn-ble-advertiser
---
Add this to your AndroidManifest.xml inside application tag
`xml
...
android:enabled="true"
android:exported="true"
android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
...
`
Add this to Info.plist file for permission
`xml
`
`js
import { Platform } from 'react-native';
import ReactNativeBleAdvertiser from 'tp-rn-ble-advertiser';
setTimeout(() => {
// start the service after setting data. Restart if the data is changed after starting
ReactNativeBleAdvertiser.startBroadcast('My Data');
setTimeout(() => {
// start the service after setting data. Restart if the data is changed after starting
ReactNativeBleAdvertiser.stopBroadcast();
}, 4000);
}, 4000);
``
---
Known issues
- Module currenly supports minimum android sdk of 22. Change your _minSdkVersion_ in android/build.gradle to 22
---
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT