Skip to content

armgit / ente

Public Imported from GitHub
0

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

feat: Register periodic task for iOS background app refresh and simplify setupIntentAction call

Prateek Sunal9717a9214281
diff --git a/mobile/ios/Runner/AppDelegate.swift b/mobile/ios/Runner/AppDelegate.swift
index 0659f708b5..7dbb6b3808 100644
--- a/mobile/ios/Runner/AppDelegate.swift
+++ b/mobile/ios/Runner/AppDelegate.swift
@@ -32,6 +32,10 @@ import workmanager
WorkmanagerPlugin.setPluginRegistrantCallback { registry in
GeneratedPluginRegistrant.register(with: registry)
}
+ // Register a periodic task in iOS 13+
+ WorkmanagerPlugin.registerPeriodicTask(
+ withIdentifier: "io.ente.frame.iOSBackgroundAppRefresh",
+ frequency: NSNumber(value: 20 * 60))
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
diff --git a/mobile/lib/app.dart b/mobile/lib/app.dart
index 99dab6c9ac..7e0caa1e51 100644
--- a/mobile/lib/app.dart
+++ b/mobile/lib/app.dart
@@ -56,9 +56,7 @@ class _EnteAppState extends State<EnteApp> with WidgetsBindingObserver {
_logger.info('init App');
super.initState();
locale = widget.locale;
- Future.delayed(const Duration(seconds: 2), () {
- setupIntentAction();
- });
+ setupIntentAction();
WidgetsBinding.instance.addObserver(this);
setupSubscription();
}