09-02-2018 02:37
09-02-2018 02:37
Hi, I am trying to build a clockface along with a companion. In my companion app a task will be running to select a date from a given list and upon reaching this date the companion app has to send a notification to to device app. I tried to do it buy using messaging api and setInterval function, but it is seen that on starting the application the device app and companion app will be connected through messaging api but after 15 seconds the companion app will be unloaded and the messaging connection will be closed so i have used the wake-interval and loaded the companion again in certain intervals of time but even after waking the companion it is seen that the connection between the the device app and the companion app are not re-stored, which is a websocket connection as i understood so that i can not send the messages to the device app. As i need to send messages to device app from companion in random time, How will i establish the connection...?
Can anyone please help me in this issue as i am running short of time to complete this.
09-03-2018 10:31
09-03-2018 10:31
As your clock is running on the device, I would just store the date on the device.
Most of this is already in the Moment clock face example. https://github.com/Fitbit/sdk-moment
I hope that helps.
09-03-2018 21:15
09-03-2018 21:15
Thanks for the reply Jon, As i am using a method similar to the one you have suggested but my problem is that whenever my companion app gets unloaded the websocket connection between the device and the companion gets disconnected and it is re-connecting only after re-running the program.