mirror of
https://github.com/bitwarden/mobile
synced 2025-12-05 23:53:33 +00:00
PM-3350 Commented event collection upload on the timer and when sending the app to background to see if that prevents the app from crashing on release mode.
This commit is contained in:
@@ -462,20 +462,21 @@ namespace Bit.iOS
|
||||
_eventTimer?.Invalidate();
|
||||
_eventTimer?.Dispose();
|
||||
_eventTimer = null;
|
||||
MainThread.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
_eventTimer = NSTimer.CreateScheduledTimer(60, true, timer =>
|
||||
{
|
||||
_eventService?.UploadEventsAsync().FireAndForget();
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LoggerHelper.LogEvenIfCantBeResolved(ex);
|
||||
}
|
||||
});
|
||||
// TODO: Uncomment, this is just a test to see if this is causing the background crash on release when sending the app to background
|
||||
//MainThread.BeginInvokeOnMainThread(() =>
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// _eventTimer = NSTimer.CreateScheduledTimer(60, true, timer =>
|
||||
// {
|
||||
// _eventService?.UploadEventsAsync().FireAndForget();
|
||||
// });
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// LoggerHelper.LogEvenIfCantBeResolved(ex);
|
||||
// }
|
||||
//});
|
||||
}
|
||||
|
||||
private async Task StopEventTimerAsync()
|
||||
@@ -485,19 +486,20 @@ namespace Bit.iOS
|
||||
_eventTimer?.Invalidate();
|
||||
_eventTimer?.Dispose();
|
||||
_eventTimer = null;
|
||||
if (_eventBackgroundTaskId > 0)
|
||||
{
|
||||
UIApplication.SharedApplication.EndBackgroundTask(_eventBackgroundTaskId);
|
||||
_eventBackgroundTaskId = 0;
|
||||
}
|
||||
_eventBackgroundTaskId = UIApplication.SharedApplication.BeginBackgroundTask(() =>
|
||||
{
|
||||
UIApplication.SharedApplication.EndBackgroundTask(_eventBackgroundTaskId);
|
||||
_eventBackgroundTaskId = 0;
|
||||
});
|
||||
await _eventService.UploadEventsAsync();
|
||||
UIApplication.SharedApplication.EndBackgroundTask(_eventBackgroundTaskId);
|
||||
_eventBackgroundTaskId = 0;
|
||||
// TODO: Uncomment, this is just a test to see if this is causing the background crash on release when sending the app to background
|
||||
//if (_eventBackgroundTaskId > 0)
|
||||
//{
|
||||
// UIApplication.SharedApplication.EndBackgroundTask(_eventBackgroundTaskId);
|
||||
// _eventBackgroundTaskId = 0;
|
||||
//}
|
||||
//_eventBackgroundTaskId = UIApplication.SharedApplication.BeginBackgroundTask(() =>
|
||||
//{
|
||||
// UIApplication.SharedApplication.EndBackgroundTask(_eventBackgroundTaskId);
|
||||
// _eventBackgroundTaskId = 0;
|
||||
//});
|
||||
//await _eventService.UploadEventsAsync();
|
||||
//UIApplication.SharedApplication.EndBackgroundTask(_eventBackgroundTaskId);
|
||||
//_eventBackgroundTaskId = 0;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user