Quellcode durchsuchen

show error if we cannot connect to notification service

B. Petersen vor 3 Jahren
Ursprung
Commit
796d8b82a3
1 geänderte Dateien mit 8 neuen und 0 gelöschten Zeilen
  1. 8 0
      deltachat-ios/Controller/ConnectivityViewController.swift

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

@@ -71,6 +71,14 @@ class ConnectivityViewController: WebViewViewController {
                 .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]
         guard let timestamps = timestamps else {
             // in most cases, here the app was just installed and we do not have any data.