ionic-ble
ionic-ble copied to clipboard
Disconnect not working with subscribe
I get this error when trying to subscribe to the disconnet callback.
this.ble.disconnect(this.device_id).subscribe((data) => {
console.log("disconnected good");
}, error => {
console.log("disconnected bad");
});
the error I get is this
Supplied parameters do not match any signature of call target.
L116: if (this.device_id) {
L117: this.ble.disconnect(this.device_id).subscribe((data) => {
L118: console.log("disconnected good");
Update:
Ok, I got it working using then() and not subscribe()
this.ble.disconnect(this.device_id).then(() => {
console.log('Disconnected');
});
BUT I need a 'failed' callback like the cordova plugin docs say I can use.
ble.disconnect(device_id, [success], [failure]);
Is this possible?