Hello fellow Fitbit developers,
I have developed an app that get the heart rate from a fitbit ionic device and sends it to the android companion. The companion is connected to a hotspot created by my laptop, which hosts a local Flask server.
When trying to POST the data from the companion to the Flask server, I get this error message
```
TypeError: Failed to fetch
```
The weird thing is that I can perform POST from a terminal I have installed in my phone, but the companion cannot perform the request itself. This is my code for fetch:
Do you have any idea what is going on?
Answered! Go to the Best Answer.
Best AnswerWhile you're supposed to be able to use http for localhost, I think that's currently broken (it wants https in all cases(!)).
I think this is a known issue; a fix has been promised.
Best Answer
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
Hi @OrestisZekai,
I think your thread may find a better home, rather than where it was originally posted in the general Ionic customer support forum. We have two dev forums, one for the SDK and one for the Web API. From your code snippet, it looks like the Web API forum may be the place for it, so I'll move it there. If I'm incorrect, just let me know here and I can place it in the SDK forum..
Best AnswerWhile you're supposed to be able to use http for localhost, I think that's currently broken (it wants https in all cases(!)).
I think this is a known issue; a fix has been promised.
Best AnswerHello @Gondwana,
looks like you are correct. I set up the same Flask server in a secure webserver over https and I can finally get messages through.
But I really hoped I would be able to do it all in my hotspot. Thanks anyway
Best Answer