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

Fetch API doesn't work

ANSWERED

Hi

I'm using the fetch API for my HA Remote app.

I experience random Type errors while using the fetch API.

For the connection I'm using HTTP to a local IP address. According to the specification that should be possible.

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

There's a bug in the latest Android app blocking local unsecured traffic. A fix should be coming in the next update.

View best answer in original post

Best Answer
0 Votes
18 REPLIES 18

It depends on the IP address; only a subset are allowed to use HTTP. However, I don't think that a security problem would manifest as a type error, nor be random.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

@Gondwana
I agree it shouldn't be random. That's why I don't understand the problem.
I also didn't change my IP address (192.168.x.x), but apparently since a couple of days it's not working anymore (that's what I mean with random, sorry for a bad wording here).

I checked with some debug logs and a dev-build but still don't see an issue neither on code side nor on configuration side.

Best Answer
0 Votes

There's a bug in the latest Android app blocking local unsecured traffic. A fix should be coming in the next update.

Best Answer
0 Votes

@JonFitbit Thanks for the info.

Best Answer
0 Votes

I'm looking forward to this fix.  After the 7-22-22 Fitbit app update my fetch no longer works either.  That's to a local web server on my phone, using the http://127.0.0.1 address.  It's just pulling JSON, but after the update it has not worked at all.

Best Answer

Hello, when will be this update released? My app started to have bad reviews from users due to this bug...

Best Answer

Is this problem SDK-specific? I have an app written for Ionic that still works (http/192.168....), however the same fetch() code consistently fails on Sense with TypeError. This has been keeping me banging my head on the monitor for the past few days. Could you confirm that it's the bug and not some breaking change in the way fetch API works between versions? Thanks.

Best Answer
0 Votes

Any update on when the fix is planned for release?

Best Answer
0 Votes

@JonFitbit Do you know when the release including the fix is planned?

Best Answer
0 Votes

it has been a year... the bug still seems to persist. is there any update on this?

Best Answer
0 Votes

Is there still a bug?

Fetch works with http://192.168.1.xxx but doesn't work with http://192.168.207.xxx

Or is this a limitation of the implementation?

Is there a workaround so it works on all local LANs?

Author | ch, passion for improvement.

Best Answer
0 Votes

See here, and subsequent.

Peter McLennan
Gondwana Software
Best Answer

@Gondwana the post you're referring to is 2yr older than my question ;).

But thanks for answering this post.

I already gave up.

Best Answer
0 Votes

Sorry; I was actually responding to @Guy_ 's post. I should have indicated that.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Thanks @Gondwana - is there any documentation about whitelisting addresses or local LANs which may extend the local IP ranges and how it can be applied for the Fitbit App, as this may be a possible workaround?

Author | ch, passion for improvement.

Best Answer
0 Votes

No, I don't think those things are possible. The only alternatives that I know are to install and use HTTPS on your LAN (difficult!), or to write a server to run on your phone that can onforward comms (also difficult!). I think there's a bad example or two of the latter approach here.

Peter McLennan
Gondwana Software
Best Answer

@Gondwana- the workaround I finally came up with for Android phones is to use MacroDroid. 

It is a very simple procedure, example given here

It's a good idea to test with the first example from your program before going to the second.

Author | ch, passion for improvement.

Best Answer

Now that you mention it, somebody once said that they installed a WAMP(?) package that did FTTPS on their Windows. I forget which package.

Peter McLennan
Gondwana Software
Best Answer
0 Votes