Closed evl5051 closed 6 years ago
Hey @evl5051, we have a PR ready for this and it will be part of the next release which is scheduled for late November/early December.
Thx for reporting this and apologies for the inconvenience.
Best, Benjamin
Let's leave this open until it's released.
We just released 5.1.0 which addresses this. I'm closing this issue.
We're tracking events in a background task which is kicked off from an actionable notification. In Apple's documentation, they recommend that we call
[UIApplication endBackgroundTask:]
when we're finished with the task. This method call immediately stops the background task.There are a few situations where we call
[BitMetricsManager trackEventWithName:]
just before we would end the background task, e.g. to record success or failure. Unfortunately, we cannot just callendBackgroundTask
aftertrackEventWithName
returns, sincetrackEventWithName
is asynchronous. If we do, there's a race condition where the event may or may not get tracked before the task gets killed.Of course, we could just introduce an artificial delay of 1s or so before calling
endBackgroundTask
, but that feels hacky to me. Is there any official recommendation on what route to take here?