Skip to content
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
@don

Description

@don

$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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions