Jelajahi Sumber

reset applicationIconBadgeNumber on reinstalls

the applicationIconBadgeNumber is remembered by the system
on reinstalls (just tested on ios 13.3.1), however, we allow re-installs also
in-app.

therefore, if the app is unconfigured (which is true for the welcome-screen),
we have to reset the counter.
B. Petersen 5 tahun lalu
induk
melakukan
0391feb485
1 mengubah file dengan 5 tambahan dan 0 penghapusan
  1. 5 0
      deltachat-ios/Coordinator/AppCoordinator.swift

+ 5 - 0
deltachat-ios/Coordinator/AppCoordinator.swift

@@ -143,6 +143,11 @@ class AppCoordinator: NSObject, Coordinator {
     }
 
     private func showWelomeController() {
+        // the applicationIconBadgeNumber is remembered by the system even on reinstalls (just tested on ios 13.3.1),
+        // to avoid appearing an old number of a previous installation, we reset the counter manually.
+        // but even when this changes in ios, we need the reset as we allow account-deletion also in-app.
+        UIApplication.shared.applicationIconBadgeNumber = 0
+
         window.rootViewController = welcomeController
         window.makeKeyAndVisible()
     }