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

add notify token to debug

B. Petersen 4 жил өмнө
parent
commit
54b8bcc1f9

+ 4 - 0
deltachat-ios/AppDelegate.swift

@@ -18,6 +18,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     var reachability = Reachability()!
     var window: UIWindow?
     var appIsInForeground = false
+    var notifyToken: String?
 
     // `didFinishLaunchingWithOptions` is the main entry point
     // that is called if the app is started for the first time
@@ -281,6 +282,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     // if so, it registers for receiving push notifications.
     func registerForNotifications() {
         UNUserNotificationCenter.current().delegate = self
+        notifyToken = nil
 
         // register for showing notifications
         UNUserNotificationCenter.current()
@@ -345,6 +347,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
                     return
                 }
                 logger.info("Notifications: request to notification server succeeded with respose, data: \(String(describing: response)), \(String(describing: data))")
+                self.notifyToken = tokenString
+
             }
             task.resume()
         } else {

+ 4 - 0
deltachat-ios/Controller/SettingsController.swift

@@ -483,6 +483,10 @@ internal final class SettingsViewController: UITableViewController, ProgressAler
             info += "\(name)=\(cnt)x\(startStr)\(timestampStr)\n"
         }
 
+        if let appDelegate = UIApplication.shared.delegate as? AppDelegate {
+            info += "notify-token=\(appDelegate.notifyToken ?? "<unset>")\n"
+        }
+
         #if DEBUG
         info += "DEBUG=1\n"
         #else