04-01-2019 07:54 - edited 04-01-2019 07:54
04-01-2019 07:54 - edited 04-01-2019 07:54
Hey everyone,
Posting data using the Fetch API in the companion app requires an internet connection
However, what happens with the data when such internet connection is not provided?
Does the Fetch API buffer all the post requests until a stable connection is available?
Or will all requests be lost (because internal storage is not provided inside the companion app itself)?
Best,
Bram
Answered! Go to the Best Answer.
04-01-2019 09:17
04-01-2019 09:17
You have 5mb storage in the companion https://dev.fitbit.com/build/reference/companion-api/local-storage/
04-01-2019 08:53
04-01-2019 08:53
I believe that fetch() will just fail if there isn't an active internet connection. You'll need to handle that in your companion code.
04-01-2019 09:13
04-01-2019 09:13
Ah ok,
But what are the possibilities to handle such failures?
From other posts, I've concluded that it is not possible to store intermediate data in the companion app... When a post request (with e.g. data from the ionic) fails, then this data will be lost forever?
04-01-2019 09:17
04-01-2019 09:17
You have 5mb storage in the companion https://dev.fitbit.com/build/reference/companion-api/local-storage/
04-01-2019 09:29
04-01-2019 09:29
Thanks for the info!
I will provide my own fallback mechanisms when fetching the data using this internal storage as buffer.