Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Socket remains closed even when the device and phone are connected and synced

I have a fitbit application that is composed from a device app and companion. Every 30 seconds I ping the companion app asking for new data (and also for keeping it alive).

 

This works well for a few hours, but after some time the condition below is never true, and I can not send anything. 

if (messaging.peerSocket.readyState === messaging.peerSocket.OPEN) {

}

 

Is there anything that I can do that might make this happen?

Anything that I can do in order to close the socket and open it again?

 

The phone and device are connected through bluetooth, and are able to sync.

Best Answer
0 Votes
1 REPLY 1

One thing that I forgot to mention is that the code can be found here:
https://github.com/sulkaharo/nsfitbit

Best Answer
0 Votes