WebBluetoothCG / demos

Demo applications showing off Web Bluetooth
https://webbluetoothcg.github.io/demos/
Apache License 2.0
624 stars 188 forks source link

playbulb: Handle blow notifications #43

Closed beaufortfrancois closed 8 years ago

beaufortfrancois commented 8 years ago

Blowing on your candle will actually turn it on/off thanks to a mini mic (small black hole). And since the device actually notifies us of this, I thought it would be nice to handle this in the demo app.

I'm still not sure about when/if I should stop notifications though. I'd love your input on this. Thanks!

R=@scheib @g-ortuno @jyasskin

localhost-8000- nexus 5x 1

jyasskin commented 8 years ago

LGTM.

As to when to stop notifications, it might make sense to stop them when the page isn't visible, but only if we can get the current state pretty quickly once the user comes back. Otherwise, it should be pretty cheap to leave notifications enabled as long as the device is connected.

cwilso commented 8 years ago

BTW, I'd really love to demo this next week at the Amsterdam PWA Dev Summit. :)

beaufortfrancois commented 8 years ago

@jyasskin I'll leave notifications enabled as long as the device is connected for now then cause I've had several issues with the Page Visibility API which has different behaviors on Mobile/Desktop.

beaufortfrancois commented 8 years ago

@cwilso Patch has been merged. You'll be able to blow out the candle and get notified in the app.