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

Ionic Companion connection

ANSWERED

I'm trying to do an app that connects to a REST service.  I'm starting from the BART sample but I think I'm missing something to make it work.  I am able to deploy to the Ionic and when I am doing UI only stuff it works fine, but I'm trying to add the http call the Ionic does not seem to connect to the phone to make the request.  Syncing in the fitbit app is working and manually syncing it does update the Fitbit data, but the app still does not show connected.

 

It checks for the connection every 3 seconds, but the socket never shows connected.

messaging.peerSocket.readyState = 1

messaging.peerSocket.readyState != messaging.peerSocket.OPEN

 

Any suggestions?  I've searched the forum but I haven't found posts of others having this problem, so hopefully I just missed something.

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

When you have an app with a companion, the developer bridge needs to be enabled on the phone and the Ionic, then connect to both devices from Studio. When the app is installed on the device, the companion is installed on the phone.

View best answer in original post

Best Answer
4 REPLIES 4

When you have an app with a companion, the developer bridge needs to be enabled on the phone and the Ionic, then connect to both devices from Studio. When the app is installed on the device, the companion is installed on the phone.

Best Answer

Thanks, that was it.  The fast reply is greatly appreciated.

Best Answer
0 Votes

I start with open weather on messaging guide (https://dev.fitbit.com/build/guides/communications/messaging/), when fitbit mobile application is active (companion running) it still get current weather but while it not active running on mobile, ionic app it will not get current weather from open api. Can it possible ionic query weather during fitbit mobile app not active running (run in backgroud)?

Best Answer
0 Votes

Ok, I solved by enabled All-Day-Sync on Fitbit mobile application that will allow ionic to communicate with companion while Fitbit mobile application not currently running.

Best Answer
0 Votes