Update usage metrics: Matomo event queue, SP=5
The app can be used offline. Attempts to post usage data to a backend (Matomo) will fail on a regular basis. This issue is meant to address this challenge by implementing some kind of queue for events meant to be logged, so that – if the logging fails – it can be processed at a later time.
What to do?
Make MatomoService handle failed logging attempts by storing the data and re-trying to post it at a later time. Set the date for the logged event to the date when the event occurred in the first place.
How to store? Use RccStorage/ItemStorage, and RccKeyValueStorageService for an example. I think I'd prefer a new named storage, but you could also directly use RccKeyValueStorageService.
When to retry? There are ways to detect if the app is online, but I suggest to retry old events, whenever the app receives focus or another even was successfully posted. I also suggest only retrying one event at a time (when successful it would automatically trigger the next re-try)