You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • This would override the GB function if it's already defined, correct? What if multiple apps want to receive events?

    Yes - however since only one app runs at a time you're kindof ok. The only potential conflict is Widgets - if you're making a 2nd widget that exists alongside Gadgetbridge, or if your app is loading widgets then there's a problem.

    What I'd suggested in another post was just to change everything to do:

    (function() {
      var _GB = global.GB;
      global.GB = function(j) {
        // ...
        if (_GB)_GB(j);
      }
    })()
    

    Since we're never going to have loads of them active it might be the most sensible solution for now.

    However, I do not know how to trigger it.

    Just make sure Gadgetbridge is connected to Bangle.js and you're sorted!

    The problem is, that I have to read what is playing, when I start the app.

    I think the best way to do this is just to send a pause command to gadgetbridge, followed by a play command. That'll cause an update in play state, which will send new data.

About

Avatar for Gordon @Gordon started