fitbit-file-messaging

Drop-in replacement for Fitbit peer socket messaging


Keywords
fitbitdev
License
MIT
Install
npm install fitbit-file-messaging@1.3.8

Documentation

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.