flutter_downloader
flutter_downloader copied to clipboard
loadTasks doesn't return tasks reliably on simulator iPhone 12 iOS 14.5
I followed the setup instructions exactly. I'm starting downloads from a method like so, which does show progress in the callback (exactly as in the docs):
Future<String?> startDownload(String url) async {
Directory directory = await getApplicationDocumentsDirectory();
final taskId = await FlutterDownloader.enqueue(
url: url,
savedDir: directory.path,
showNotification: true, // Android only
openFileFromNotification: false, // Android only
);
return taskId;
}
Yet, calling the method as described in the docs:
List<DownloadTask>? tasks = await FlutterDownloader.loadTasks();
Often results in zero results, even though you have started a download prior. This seems completely random.
I've also tried with a query with the same result, zero items. e.g.
List<DownloadTask>? tasks = await FlutterDownloader.loadTasksWithRawQuery(
query: "SELECT * FROM task",
);
Similar problem for me too
Same issue i facing.
Same issue i facing.
The databaseQueue might be static?
Using loadTasksWithRawQuery
while NSURLSession calling back and updating database, it can cause database locking problem.