Przeglądaj źródła

NotificationContent app killed

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 lat temu
rodzic
commit
2585f49af8

+ 8 - 0
iOSClient/AppDelegate.swift

@@ -288,6 +288,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     func applicationWillTerminate(_ application: UIApplication) {
 
         NCNetworking.shared.cancelAllDownloadTransfer()
+
+        let content = UNMutableNotificationContent()
+        content.title = NCBrandOptions.shared.brand
+        content.body = NSLocalizedString("_keep_running_", comment: "")
+        let req = UNNotificationRequest(identifier: UUID().uuidString, content: content, trigger: nil)
+        let notificationCenter = UNUserNotificationCenter.current()
+        notificationCenter.add(req)
+
         NKCommon.shared.writeLog("bye bye")
     }
 

+ 1 - 0
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -890,6 +890,7 @@
 "_description_toolbarwidget_"   = "A toolbar to speed up your operations.";
 "_no_data_available_"       = "No data available";
 "_widget_available_nc25_"   = "Widget only available starting with Nextcloud 25";
+"_keep_running_"            = "Keep the app running for a better user experience";
 
 // Video
 "_select_trace_"            = "Select the trace";