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

Background communication

I need to transfer data from my ionic to a server, and conversely, when the companion app is closed or in background using websocket, if possible. Is this possible or the companion app should be active?

Data will be in json or url encoded format

Best Answer
0 Votes
4 REPLIES 4

@MarcS7 wrote:

I need to transfer data from my ionic to a server, and conversely, when the companion app is closed or in background using websocket, if possible. Is this possible or the companion app should be active?

Data will be in json or url encoded format


Hello Marc,

 

While the Ionic has WiFi and Bluetooth, the watch can only communicate with its peer, the companion app. The app does not need to be open though, as long as it has "run_background" permission.

 

Comms seem to work best when treated as asynchronous. The watch is not always connected to the app, the app is not always connected to the Internet, the Internet is not always timely. Data requests, data packets and receipts need to wait if the links are down and send when sockets are re-connected.

 

Regards,

Reign

Best Answer
0 Votes

@morningReign wrote:

@MarcS7 wrote:

I need to transfer data from my ionic to a server, and conversely, when the companion app is closed or in background using websocket, if possible. Is this possible or the companion app should be active?

Data will be in json or url encoded format


Hello Marc,

 

While the Ionic has WiFi and Bluetooth, the watch can only communicate with its peer, the companion app. The app does not need to be open though, as long as it has "run_background" permission.

 

Comms seem to work best when treated as asynchronous. The watch is not always connected to the app, the app is not always connected to the Internet, the Internet is not always timely. Data requests, data packets and receipts need to wait if the links are down and send when sockets are re-connected.

 

Regards,

Reign


this solution can work for a constant flow of data? i didn't decide yet if the flow of data wil be constantly or not and i need to synchronize the data with the fitbit app or not?

basically my project is to control a object from remote and get some information and i will send some information, this is why i need to know if i need to synchronize the watch with the fitbit app.

Best Answer
0 Votes

The watch doesn't need to be synchronised with the companion, but it does need to be connected (obviously).

 

Companion app comms can be faster if the Fitbit app is running in the foreground, but I've been able to stream data at 30 messages per second with it running in the background.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

30 messages per seconds will be enough, I will keep the app in background hoping that iOS will not kill the process the save ram

i will update this topic in case of help 

Best Answer
0 Votes