https://github.com/don/ble-background
Use cordova-plugin-ble-central to scan, connect, & receive notifications while app is in background
https://github.com/don/ble-background
Last synced: about 1 year ago
JSON representation
Use cordova-plugin-ble-central to scan, connect, & receive notifications while app is in background
- Host: GitHub
- URL: https://github.com/don/ble-background
- Owner: don
- Created: 2016-08-19T05:22:26.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-19T05:30:13.000Z (almost 10 years ago)
- Last Synced: 2025-03-18T18:06:55.362Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 14
- Watchers: 6
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BLE background
This project demonstrates [cordova-plugin-ble-central](https://github.com/don/cordova-plugin-ble-central) scanning, connecting, and receiving notifications in while running in the background.
The app looks for a peripheral running the counter service and automatically connects. Once connected, the app subscribes for count notifications. If the app is in the background, the user is notified via local notifications.
## Installing
### iOS
$ git clone https://github.com/don/ble-background.git
$ cd ble-background
$ cordova platform add ios
$ cordova run ios --device
### Android
$ git clone https://github.com/don/ble-background.git
$ cd ble-background
$ cordova platform add android
$ cordova run android --device
### Peripheral
The application needs a peripheral running the counter service. The counter service increments a number and sends a notification every 5 seconds. This projects includes and Arduino version of the counter service that runs on the [Arduino 101](http://store-usa.arduino.cc/products/abx00005) or any board supported by [blePeripheral](https://github.com/sandeepmistry/arduino-BLEPeripheral). An experimental Node.js verion of the service is also available.
See [arduino/Counter/Counter.ino](arduino/Counter/Counter.ino) for the Arudino sketch and [counter/](counter/) for the Node.js code.