Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

Commit

Permalink
Fixed background task log
Browse files Browse the repository at this point in the history
  • Loading branch information
cocoa-dev004 committed Jul 28, 2022
1 parent 5268c94 commit 2257746
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Covid19Radar/Covid19Radar.iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ public override bool FinishedLaunching(UIApplication app, NSDictionary launchOpt
// https://developer.apple.com/documentation/backgroundtasks/bgtaskscheduler/3180427-register
ScheduleBackgroundTasks();

try
{
LoggingPendingTaskRequests();
}
catch (Exception ex)
{
_loggerService.Value.Exception("Failure get pending task requests", ex);
}

return base.FinishedLaunching(app, launchOptions);
}

Expand Down Expand Up @@ -166,7 +175,8 @@ private void LoggingPendingTaskRequests()
_loggerService.Value.Info($"Pending task count: {pendingTaskRequests.Length}");
foreach (var pendingTaskRequest in pendingTaskRequests)
{
_loggerService.Value.Info($"Identifier: {pendingTaskRequest.Identifier}, EarliestBeginDate: {pendingTaskRequest.EarliestBeginDate}");
string identifier = pendingTaskRequest.Identifier.Split(".")?.Last();
_loggerService.Value.Info($"Identifier: {identifier}, EarliestBeginDate: {pendingTaskRequest.EarliestBeginDate}");
}
});
}
Expand Down

0 comments on commit 2257746

Please sign in to comment.