mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-30 13:19:44 +02:00
fix(downloads/extensions): iOS background task, serialize extension mutations, safer batch convert sheet
- iOS: begin/end UIBackgroundTask while a download queue is active so in-flight downloads survive backgrounding for the limited window iOS allows - extensions: serialize install/upgrade/remove in the Go manager (mutationMu) and in the Dart store provider to stop concurrent goja VM teardown/reload from hard-crashing the app - main: add runZonedGuarded + FlutterError/PlatformDispatcher onError so uncaught Dart errors are logged, not fatal - batch convert sheet: precompute localized title/label before showModalBottomSheet to avoid Localizations lookup via a deactivated context
This commit is contained in:
1 parent
ca413a16fa
commit
6b5345a6e5
9 files changed
+213
-20
No files matched your search
@@ -865,6 +865,26 @@ class PlatformBridge {
|
||||
return result as bool;
|
||||
}
|
||||
|
||||
/// iOS only: mark that a download queue is active so the app keeps in-flight
|
||||
/// downloads running for a short window whenever it is backgrounded. iOS
|
||||
/// grants a limited budget (roughly 30s on modern versions) per background
|
||||
/// entry; there is no foreground-service equivalent, so this is best-effort.
|
||||
static Future<void> beginBackgroundDownloadTask() async {
|
||||
if (!Platform.isIOS) return;
|
||||
try {
|
||||
await _channel.invokeMethod('beginBackgroundDownloadTask');
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
/// iOS only: mark that the download queue is no longer active (queue finished
|
||||
/// or paused), stopping background-time extension.
|
||||
static Future<void> endBackgroundDownloadTask() async {
|
||||
if (!Platform.isIOS) return;
|
||||
try {
|
||||
await _channel.invokeMethod('endBackgroundDownloadTask');
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
static Future<void> startNativeDownloadWorker({
|
||||
required List<Map<String, dynamic>> requests,
|
||||
Map<String, dynamic> settings = const {},
|
||||
|
||||
Reference in new issue
Block a user