05-06-2020 19:08 - edited 05-06-2020 19:50
05-06-2020 19:08 - edited 05-06-2020 19:50
I think the Campanion api can do that, but if you look closely, it doesn't seem like it, so I ask for help.
If yes, please tell me how to do it
my device versa2 / s8+
Answered! Go to the Best Answer.
05-06-2020 19:24
05-06-2020 19:24
Not using the SDK. Your only options are fetch() or WebSocket. That said, you can write your own server and host it on the companion device.
If you can't go via a server, you'll have to use the Web API.
05-06-2020 19:24
05-06-2020 19:24
Not using the SDK. Your only options are fetch() or WebSocket. That said, you can write your own server and host it on the companion device.
If you can't go via a server, you'll have to use the Web API.
05-06-2020 20:14
05-06-2020 20:14
There is api not supported by web api, so what I want is companion api :(...
Is there any other way?
05-06-2020 20:19 - edited 05-06-2020 20:20
05-06-2020 20:19 - edited 05-06-2020 20:20
No, you're going to need a server of some sort.
05-07-2020 06:56
05-07-2020 06:56
The only method I know is to run either a webserver or websocket server in your app, and communicate from the companion using either fetch() or websocket.
05-07-2020 21:21
05-07-2020 21:21
So, are filetransfer and message api that mobile sends to server, not device? Is this right?
05-07-2020 21:39
05-07-2020 21:39
No. File transfer and message API are between the watch (device) and the clockface/app companion code, which runs within the Fitbit app. They won't help you to get your data outside of the Fitbit system. For that, you have to use fetch() or WebSocket, which can go from your clockface/app companion code to a server.
05-07-2020 23:04
05-07-2020 23:04
I feel grateful Gondwana
So what is the last thing that file transfer and messaging api do? Can you give me an example?
05-07-2020 23:30
05-07-2020 23:30
Documentation (with examples) is here and here.
The last thing that messaging can do is to populate a variable in your companion code.
The last thing that file transfer can do is to save a file on your companion device. Unfortunately, there's no way to directly access that file from outside of the companion code, so you have to read it into one or more variables in your companion code.
05-07-2020 23:40
05-07-2020 23:40
Is the device that you are talking about here a fitbit device?
So what the file transfer api does is store the file on the fitbit device.
I definitely understand that there is no way to send from fitbit device to my phone without going directly through the server.
thx 🙂
05-08-2020 00:04
05-08-2020 00:04
It depends in which direction you're sending the file. In your case, you're probably sending it to the companion device (eg, phone). Therefore, the file will be on your phone, but not in any directory that you can access from outside of your companion code. That's why you need to onforward it to a server, even if the server is hosted on the phone.
05-08-2020 00:06
05-08-2020 00:06
It was really helpful
thx bro have a nice day 🙂