I can simulate the background fetch using iOS simulator. Is it possible to simulate the expiration so it can call the expire handler? I tried to use a infinite loop and run as background fetch on an simulator but doesn't seem to trigger it.
task = UIApplication.SharedApplication.BeginBackgroundTask("bgEntityDownload", () =>
{
AppLogger.Instance.AddLog(AppLogLevel.Information,
nameof(BgProcess),
nameof(DownloadEntityFromServer),
"Background Fetch Expired", "");
App.CurrentDataStatus.HasSync = new EntityQueueBLL().HasData(siteId);
UIApplication.SharedApplication.EndBackgroundTask(task);
task = UIApplication.BackgroundTaskInvalid;
System.Diagnostics.Debug.WriteLine("Ending .....");
completionHandler?.Invoke(UIBackgroundFetchResult.NewData);
});