在我的应用中,最新通知正在替换上一个,如何停止此行为表明所有通知都会显示在通知中心,直到用户清除为止。
if #available(iOS 10.0, *) {
let center = UNUserNotificationCenter.current()
//center.delegate = self
center.requestAuthorization(options: [.sound, .alert, .badge]) { (granted, error) in
if error == nil{
UIApplication.shared.registerForRemoteNotifications()
}
}
} else {
UIApplication.shared.registerUserNotificationSettings(UIUserNotificationSettings(types: [.sound, .alert, .badge], categories: nil))
UIApplication.shared.registerForRemoteNotifications()
}