That's the basic idea, except we don't want to do it in the android app, but in the messages library, so it also works with ios.
So it becomes
A message is sent from Gadgetbridge to the Bangle.
The Android app receives the Gadgetbridge message.
The Android app tells the messages library it has a new message.
The messages library emits a signal saying it has a new message.
THEN
A custom app acts on the signal, doing whatever it does.
The messages library sees that something acted on the signal, and does nothing else.
OR
Nothing receives the signal
The messages app sees that nothing acted on the signal, and launches the default app.
I've pretty much already done this here, except that is written as a replacement messages app, so it needs to be adapted into messages/lib.js changes instead. (And then the replacement app won't need its own library anymore, yay)
And as @Gordon noted above, there is a PR waiting which also makes some drastic changes to the library. Also rewriting it into an event driven system might complicate merging "a bit" ;-)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
That's the basic idea, except we don't want to do it in the
android
app, but in themessages
library, so it also works withios
.So it becomes
THEN
OR
I've pretty much already done this here, except that is written as a replacement
messages
app, so it needs to be adapted intomessages/lib.js
changes instead. (And then the replacement app won't need its own library anymore, yay)And as @Gordon noted above, there is a PR waiting which also makes some drastic changes to the library. Also rewriting it into an event driven system might complicate merging "a bit" ;-)