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

Every message from the device app to the companion app loses all data.

ANSWERED

Even using the simple weather app sample, every message iI send via messaging.peerSocket.send from the device app gets received as {"isTrusted":false} with no other data.  The message is received, just without any of the data I added.  I'm using a simulator for both the device and companion app.  Is this just not supported?

Best Answer
1 BEST ANSWER

Accepted Solutions

I was bashing my head against the wall with exactly the same problem for some time. In my case the problem was that I failed to notice that the message is actually in the `data` member of the event object you get. This `data` itself is not an 'own' property of the event, ie it's inherited from a class definition or so, so it does not show up when JSON.stringifying() the event.

View best answer in original post

Best Answer
3 REPLIES 3

Can you provide some code? Or perhaps start with the sample here:

 

https://dev.fitbit.com/build/guides/communications/messaging/

Best Answer
0 Votes

I was bashing my head against the wall with exactly the same problem for some time. In my case the problem was that I failed to notice that the message is actually in the `data` member of the event object you get. This `data` itself is not an 'own' property of the event, ie it's inherited from a class definition or so, so it does not show up when JSON.stringifying() the event.

Best Answer

@triggi I was having the same issue and your suggestion solved it, thanks.

Best Answer