I cannot get Fetch working with http://. Is it possible to use Fetch with http:// instead of https:// addresses?
Or get data from such a server in another way?
Answered! Go to the Best Answer.
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Good news everyone!
Version 2.42 of the iOS will include this fix!
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Are you on iOS? It's probably because of ATS:
In the future, would it be possible to enable the ATS bypass for local devices, for example, an IoT or media device? One of my devices has an intranet-only REST API that only responds to HTTP requests.
According to the link, it looks like the "NSAllowsLocalNetworking" key might (I'm not an iOS developer) allow for this. Right now, I get a 400 error when I communicate with a local HTTP server, which is expected and leads me to believe it isn't already enabled.
I have ways to work around this on my own network, but wouldn't be usable if I wanted to publish my app on the Gallery when it becomes available.
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Good news everyone!
Version 2.42 of the iOS will include this fix!
I get an empty response for an HTTP request that I know returns data. I am using Samsung Galaxy 8. Can the Fitbit Fetch API perform an HTTP request?
Best AnswerThis is still an issue on Android for version 2.68.
It works fine with https, but for http it gives a 400 error regardless of the url.
Let me know if you'd need me to give any other information.
This is still an issue for Android version 2.69!! 😭 http urls return nothing whereas https returns content.
I am very disappointed! I first developed my app using the Fitbit OS Simulator before I received my Fitbit Versa. In the simulator, both https and http work fine. So, when I was testing the app in the simulator, it was working fine. But on the actual device it was erroring out! I spent a few hours before I stumbled on this thread! The simulator gave me false hope that my app will work!
Please Fitbit, please please fix this soon! 😭
I have a hacky workaround as of now. Try using https://script.google.com/ to query the insecure http:// url. And use this script instead of the original in your app. It is like wrapping around the insecure url in a secure version.
This has obvious limitations. You can only do around 20,000 (or is it 50,000) fetch calls in a day. For a more permanent solution, you may need to run your own backend. But for me, this works as I have an app I made that only I use as of now.
I may need to come up with a more robust backend for my app if I need to make this mainstream.
Best Answer@shermj scratch that.
I have a better solution. Use a url shortener like bit.ly. It will create an https url for you and query that.
:activate-troll-face: Yes! Maximum hackery!
Edit: Confirmed working in Fitbit Studio using an actual Fitbit Versa (not the simulator, because the http:// urls work in the simulator anyway!! What?)
It's a problem on Android too. Please notice, I'm trying to connect to "localhost", so it should work according to Fetch API documentation
TypeError: Failed to fetch - Please use https:// when communicating with internet endpoints. https://dev.fitbit.com/reference/companion-api/fetch/
Best AnswerI am using IOS app ver 3.12 (913) and I still see the error that the fetch wants me to use https://
Best AnswerHello,
This issue is still valid android user. when I try to send the data to local server with http, I get fetch fail but the code works well when I send the data to cloud firebase. Anyone to guide me? steps or configurations needed will be much appreciated
Best Answerhttp will only work with specific IPs, which usually equate to localhost. A workaround is to write a server for your Android device (localhost) that can accept http from the Fitbit app, and forward those to your LAN server.
Installing a non-self-signed (https) cert on the server would be nicer, but that can be difficult.
Best AnswerThanks. I installed https on localhost and I should be able to transfer the data.