소스 검색

Do not show foreground messages in the message center. iOS puts foreground notifications above grouped background notifications as a list of single notifications (thus the foreground notification option .list). There's no API to force those notifications being grouped even though they got a threadIdentifier. After all, grouped background notifications seem to be more valuable than foreground notifications, so we remove the latter feature in favor of getting the former right."

cyberta 4 년 전
부모
커밋
830144c186
2개의 변경된 파일1개의 추가작업 그리고 12개의 파일을 삭제
  1. 1 7
      deltachat-ios/AppDelegate.swift
  2. 0 5
      deltachat-ios/Helper/NotificationManager.swift

+ 1 - 7
deltachat-ios/AppDelegate.swift

@@ -426,15 +426,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     // MARK: - Handle notification banners
 
     // This method will be called if an incoming message was received while the app was in forground.
-    // On iOS 14+ we show a non-intrusive notification in the notification center, if the notification doesn't belong to a currently opened chat.
-    // On pre iOS 14 this feature isn't available so we're just triggering to show the badge at the launcher icon. This will only have an effect for unread messages > 0
     func userNotificationCenter(_: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
         logger.info("forground notification")
-        if #available(iOS 14.0, *) {
-            completionHandler([.list, .badge])
-        } else {
-            completionHandler([.badge])
-        }
+        completionHandler([.badge])
     }
 
     // this method will be called if the user tapped on a notification

+ 0 - 5
deltachat-ios/Helper/NotificationManager.swift

@@ -40,11 +40,6 @@ public class NotificationManager {
                    let chatId = ui["chat_id"] as? Int,
                    let messageId = ui["message_id"] as? Int,
                    !UserDefaults.standard.bool(forKey: "notifications_disabled") {
-                    
-                    if let lastChatId = AppStateRestorer.shared.restoreLastActiveChatId(),
-                       lastChatId == chatId {
-                        return
-                    }
 
                     NotificationManager.updateApplicationIconBadge(reset: false)