I just tested on Version 59.0.3071.104 (Official Build) (64-bit) Linux with the following code and I was able to get notifications:
navigator.bluetooth.requestDevice({filters: [{services: ['health_thermometer']}]})
.then(device => {
return device.gatt.connect();
})
.then(server => {
return server.getPrimaryService('health_thermometer');
})
.then(service => {
return service.getCharacteristic('temperature_measurement');
})
.then(characteristic => {
characteristic.addEventListener('characteristicvaluechanged',
() => console.log('notification received'));
characteristic.startNotifications();
});
The characteristics returned by both functions should be the exact same object so there shouldn't be any differences between attaching the event listener before or after the promise.
If the problem seems to be on Chrome side feel free to open an issue at
http://crbug.com/new. Please attach some logs so that we can take a closer look. Instructions
here.
Gio