08-12-2019 22:56
08-12-2019 22:56
Is there a way for the Companion app to listen for 3rd party app messages/notifications? I'm working on an alarm app that needs to alert both the Watch and a 3rd party app which might or might not be on the same phone as the watch's Companion app. The kicker is, the alarm for both watch and phone can only be turned off via a button on the 3rd party app. I need to find a way to detect a call/notif from the 3rd party app to the Companion app. I'm thinking of making the 3rd party app set a flag on our 3rd party server, then have the Companion app continuously do a fetch call on it checking if the Alarm has been turned off. This continuous call would only happen if an alarm is firing. Is there any other way to do this?
08-13-2019 01:21
08-13-2019 01:21
Maybe use the websocket API so the server can communicate directly to the companion if the flag is set.
https://dev.fitbit.com/build/reference/companion-api/websocket/
https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API