Drop-in replacement for Fitbit peer socket messaging - just replace the imports (in both app and companion)
- import * as messaging from 'messaging';
+ import * as messaging from 'fitbit-file-messaging';
messaging.peerSocket.onmessage = evt => {
// this code doesn't change
}
messaging.peerSocket.addEventListener('open', evt => {
// this code doesn't change
})
messaging.peerSocket.send(data)
This messaging uses file transfer under the hood, so it's more reliable than regular messaging.