When I try to reach a .jpg file from a public IP address while running the app from the simulator it works perfectly but when I try to load the file from an actual device (Fitbit versa) it doesn't get any data.
If I switch to a local IP address it works as expected.
Answered! Go to the Best Answer.
Best AnswerYes the network is OK also the permissions are correct.
Like I mentioned it works in the local network http://192.168.x.x/api but when I switch to my public ip address it doesn't work (using http).
My workaround was to create an Azure function (it uses https) that calls my http service.
So my conclusion is you cannot make http requests with the actual device, that's a boomer given that the simulator works OK.
Best AnswerHave you given your app Internet privileges in the package.json?
Otherwise we'll need to see code to know more. There's some example code here : https://dev.fitbit.com/build/guides/communications/file-transfer/
I struggled with getting the example file transfer to work originally but it turns out here's a bug with filename character case: https://community.fitbit.com/t5/SDK-Development/File-Transfer-Extension-Capitalisation/m-p/2366479
Sometimes network connectivity on my phone breaks and I can get it back by restarting my phone, so I'd check that too.
Best AnswerYes the network is OK also the permissions are correct.
Like I mentioned it works in the local network http://192.168.x.x/api but when I switch to my public ip address it doesn't work (using http).
My workaround was to create an Azure function (it uses https) that calls my http service.
So my conclusion is you cannot make http requests with the actual device, that's a boomer given that the simulator works OK.
Best AnswerAh yes, makes sense now.
Some fitbit companions do not support HTTP (I believe Android and Windows Mobile still), only HTTPS. However the simulator does not enforce this constraint/bug (and said constraint/bug is not yet documented).
See: https://community.fitbit.com/t5/SDK-Development/Is-Fetch-limited-to-https/m-p/2220283#M270
Best Answer