matomo-sdk-ios icon indicating copy to clipboard operation
matomo-sdk-ios copied to clipboard

Add better better support for sending events in the background

Open brototyp opened this issue 4 years ago • 1 comments

This PR tries to fix issues (#331, #327) when bringing the app to the background, while dispatching events.

There are multiple approaches.

  1. Ensure retransmission of the same event doesn't lead to duplicate events in the backend. This requires changes on the backend side.
  2. Uploading events using a background URLSession. Downside of this approach is that a background session doesn't guarantee timely execution of the request and doesn't give us too much / enough control over how requests are sent or re-sent.
  3. Starting a background task before transmitting and ending it right after. This is the approach taken in this PR:

brototyp avatar Nov 01 '20 12:11 brototyp

1 Error
:no_entry_sign: Please add a line to the CHANGELOG.md since you changed the SDK.
1 Warning
:warning: Are there any changes that should be explained in the README.md?

Generated by :no_entry_sign: Danger

brototyp-bot avatar Nov 01 '20 12:11 brototyp-bot