瀏覽代碼

show error if we cannot connect to notification service

B. Petersen 3 年之前
父節點
當前提交
796d8b82a3
共有 1 個文件被更改,包括 8 次插入0 次删除
  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.