Closed joserebelo closed 1 year ago
This will probably break app, since Zepp (not even the modified one) app-side fetch has its own implementation and has one argument with URL string for GET request and settings object for POST and the url needs to be specified in it
https://docs.zepp.com/docs/reference/side-service-api/fetch/
If possible, it is better to make a global variable that allows you to understand in which runtime the app-side is running or repeat the implementation as in Zepp
I marked this PR as draft, but I should have actually closed it.
Makes no sense to do changes to the app if it already works on the official app - and I missed that fetch override, thanks.
I will update Gadgetbridge to override the fetch function as well.
I am not sure how this works in the modified Zepp App, as I do not have it, but while trying to run this on Gadgetbridge, and even locally, I ran into the following issue:
It looks like the object is being stringified as a URL, resulting in a failed request.
This PR splits the url from the options, which should fix the issue. I have not been able to fully test this, as Gadgetbridge support is still not fully working, but I see the GET request hitting the server correctly.