Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Gate background sync notification

Prateek Sunal6eb2794358d8
diff --git a/mobile/apps/photos/ios/Runner/AppDelegate.swift b/mobile/apps/photos/ios/Runner/AppDelegate.swift
index 2d4b3d0988..16ead278f0 100644
--- a/mobile/apps/photos/ios/Runner/AppDelegate.swift
+++ b/mobile/apps/photos/ios/Runner/AppDelegate.swift
@@ -98,6 +98,8 @@ import workmanager_apple
withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void
) {
let content = notification.request.content
+ // iOS suppresses foreground notification presentation unless the delegate
+ // opts in, so explicitly allow only our internal Workmanager debug thread.
if content.threadIdentifier == Self.workmanagerDebugThreadIdentifier {
if #available(iOS 14.0, *) {
completionHandler([.list, .banner])
diff --git a/mobile/apps/photos/lib/utils/bg_task_utils.dart b/mobile/apps/photos/lib/utils/bg_task_utils.dart
index 34bfd1cb3d..7cf7c67681 100644
--- a/mobile/apps/photos/lib/utils/bg_task_utils.dart
+++ b/mobile/apps/photos/lib/utils/bg_task_utils.dart
@@ -87,9 +87,7 @@ class BgTaskUtils {
frequency: Platform.isIOS
? const Duration(minutes: 30)
: const Duration(minutes: 15),
- // TODO: Remove the forced zero delay once Workmanager debug notification testing is done.
- initialDelay:
- (kDebugMode || true) ? Duration.zero : const Duration(minutes: 10),
+ initialDelay: kDebugMode ? Duration.zero : const Duration(minutes: 10),
constraints: workmanager.Constraints(
networkType: workmanager.NetworkType.connected,
requiresCharging: false,