This repository was archived by the owner on Sep 15, 2021. It is now read-only.
This repository was archived by the owner on Sep 15, 2021. It is now read-only.
$cordovaBLE.startNotification shouldn't use a Promise #981
Open
Description
$cordovaBLE.startNotification shouldn't use a Promise.
ble.startNotification calls the success callback whenever the value of a Bluetooth characteristic changes. This callback may be called many times so a promise won't work here.
I'm not sure what the right solution is for ng-cordova. Maybe the user could just handle ble.startNotification in their service?
I have a non-ionic example that uses the bleno test service to demonstrate notifcations. You can run this test peripheral on OS X or Linux. Clone the repo and node test.js
create a new cordova project
$ cordova create notify com.example.notify Notify
replace notify/www/js/index.js with https://gist.github.com/don/d9fef2fb45fbd67a372d
$ cd notify
$ cordova plugin add cordova-plugin-ble-central
$ cordova platform add android
$ cordova run --device
Metadata
Metadata
Assignees
Labels
No labels