I am trying to get the BART example working, but the peersocket readystate never moves to open, so data is never sent to the Ionic. The console logging shows that the data is being fetched correctly, it just never passes the readstate==open check. I do have a solid bluetooth connection between my Ionic and my device.
Does anyone know if something is missing from the example or what may be wrong?
Best AnswerIt is enabled, otherwise it would not deploy and I would not have seen the results of the HTTP fetch.
Best AnswerTry to put a console.log message on the receiving end to see if the message is passed. Also, I always have to try few times to run the app I am developing before seeing the message.
E.g. in the app/index.js
// Listen for messages from the companion
messaging.peerSocket.onmessage = function() {
console.log("received data");
}
Best Answer@agsurf5, the code does already have that and it is not firing. There are console.logs all over the place and it never shows readystate=open so it never gets to sending the message. I did try having it send anyway, but that threw an error that it wasn't connected as I expected it would.
Looks like the problem may be the Windows 10 Fitbit app. The peerSocket does not open on the companion on either Windows 10 Pro or Windows 10 Mobile, tried using my Kindle Fire HD8 and first try it showed the readyState===Open and it got to sending the message.
I am having the same issue on Lumia 950. Setting works fine for built-in clock faces, but not for my own app. I am also having issues with the weather app - it is working for a few days and then it stops suddenly - I have to uninstall/reinstall the phone app to get it working again.
Best AnswerOk I got it working on Windows 10 Mobile:
The socket opens fine, but it is the "messaging.peerSocket.readyState === messaging.peerSocket.OPEN" part that does not work. Changing this check in the companion code to "messaging.peerSocket.readyState == 0" fixed the issue.
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
@jimm98y wrote:
Ok I got it working on Windows 10 Mobile:
The socket opens fine, but it is the "messaging.peerSocket.readyState === messaging.peerSocket.OPEN" part that does not work. Changing this check in the companion code to "messaging.peerSocket.readyState == 0" fixed the issue.
I know the open and closed constants were missing in one of the releases. Is the Fitbit windows mobile app up to date?
Best AnswerAccording to Windows Store there is no available update. In the about it shows version 2.27.1318(49165).
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
@jimm98y wrote:
According to Windows Store there is no available update. In the about it shows version 2.27.1318(49165).
It's fixed in the next version, which should be available within the next few days.
Best Answer