Эх сурвалжийг харах

show error if we cannot connect to notification service

B. Petersen 3 жил өмнө
parent
commit
796d8b82a3

+ 8 - 0
deltachat-ios/Controller/ConnectivityViewController.swift

@@ -71,6 +71,14 @@ class ConnectivityViewController: WebViewViewController {
                 .appending(String.localized("notifications_disabled"))
                 .appending(String.localized("notifications_disabled"))
         }
         }
 
 
+        if let appDelegate = UIApplication.shared.delegate as? AppDelegate {
+            if appDelegate.notifyToken == nil {
+                return "<span class=\"red dot\"></span>"
+                    .appending(title)
+                    .appending("Service error")
+            }
+        }
+
         let timestamps = UserDefaults.standard.array(forKey: Constants.Keys.notificationTimestamps) as? [Double]
         let timestamps = UserDefaults.standard.array(forKey: Constants.Keys.notificationTimestamps) as? [Double]
         guard let timestamps = timestamps else {
         guard let timestamps = timestamps else {
             // in most cases, here the app was just installed and we do not have any data.
             // in most cases, here the app was just installed and we do not have any data.