09-30-2017 17:27 - edited 09-30-2017 19:11
09-30-2017 17:27 - edited 09-30-2017 19:11
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.
10-03-2017 08:12
10-03-2017 08:12
Good news everyone!
Version 2.42 of the iOS will include this fix!
10-02-2017 13:48
10-02-2017 13:48
Are you on iOS? It's probably because of ATS:
10-02-2017 15:08
10-02-2017 15:08
Yes I am. Good to know.
10-02-2017 19:32 - edited 10-02-2017 19:33
10-02-2017 19:32 - edited 10-02-2017 19:33
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.
10-03-2017 08:12
10-03-2017 08:12
Good news everyone!
Version 2.42 of the iOS will include this fix!
11-02-2017 15:55
11-02-2017 15:55
Did this change make the final version of 2.42? I'm sure it's my code at this point, but wanted to make sure the change was in before I start debugging.
12-27-2017 23:59
12-27-2017 23:59
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?
03-21-2018 04:14
03-21-2018 04:14
This 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.
04-18-2018 20:01
04-18-2018 20:01
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! 😭
04-25-2018 17:12
04-25-2018 17:12
This still seems to be an issue with http..anyone have any updates or fixes?
04-25-2018 20:34 - edited 04-25-2018 20:34
04-25-2018 20:34 - edited 04-25-2018 20:34
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.
04-25-2018 20:36 - edited 04-25-2018 20:42
04-25-2018 20:36 - edited 04-25-2018 20:42
@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?)
04-26-2018 10:04
04-26-2018 10:04
Awesome! Thank you I'll try this
04-21-2019 11:01 - edited 04-21-2019 13:11
04-21-2019 11:01 - edited 04-21-2019 13:11
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/
04-21-2019 13:08
04-21-2019 13:08
please provide the script, the link shows "no projects"
12-18-2019 22:27
12-18-2019 22:27
I am using IOS app ver 3.12 (913) and I still see the error that the fetch wants me to use https://
12-18-2019 22:31
12-18-2019 22:31
I tried using bitly, but didn't work for me.
Gives TypeError: Failed to fetch
04-12-2024 20:51
04-12-2024 20:51
Hello,
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
04-12-2024 21:23 - edited 04-12-2024 21:24
04-12-2024 21:23 - edited 04-12-2024 21:24
http 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.
04-13-2024 07:48
04-13-2024 07:48
Thanks. I installed https on localhost and I should be able to transfer the data.