I’m using the BLE Plugin to connect to a heart rate monitor. I have a Bluetooth settings page where the connection takes place, and a subscription to incoming packets is established:
var count = 0;
BLE.startNotification(peripheral.id, scanInfo.service, scanInfo.heartrate).subscribe(buffer => {
var data = new Uint8Array(buffer);
content.innerHTML = data[1];
count += 1;
BluetoothPage.storage.set(count.toString(),data[1]);
});
But when you leave the Bluetooth page (it gets popped off with nav-pop
) the data is no longer being stored because the subscription stops. I want it to continuously be recorded wherever the user is in the app. How can I do this?