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

WebSocket only works in simulator

Hi, I'm trying to have my companion app and my local server communicate with the WebSocket API. When I try it with the simulator it works no problem, but when I try on my device I get this error message: Fitbit.CompanionHost.Bridge.Modules.EventTarget.JsEventModule.

Does anyone know what it means and how to fix it?

 

My companion app is on the same computer as my server, I made sure to allow internet communication in package.json and I tried with localhost and my IP.

I've also tried using fetch() and it also only works in the simulator. Otherwise, I get the error message "A connection with the server could not be established".

Best Answer
0 Votes
2 REPLIES 2

Have you enabled the internet permission in your package.json?

Best Answer
0 Votes

Yes, I even check in code with

me.permissions.granted("access_internet")

 

Best Answer
0 Votes