|
@@ -129,6 +129,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
|
|
|
func applicationWillEnterForeground(_: UIApplication) {
|
|
func applicationWillEnterForeground(_: UIApplication) {
|
|
logger.info("---- foreground ----")
|
|
logger.info("---- foreground ----")
|
|
|
|
+ logger.debug("---- UNUserNotificationCenter.delegate: \(UNUserNotificationCenter.current().delegate)---- ")
|
|
appIsInForeground = true
|
|
appIsInForeground = true
|
|
dcContext.maybeStartIo()
|
|
dcContext.maybeStartIo()
|
|
if reachability.connection != .none {
|
|
if reachability.connection != .none {
|
|
@@ -415,7 +416,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
|
|
|
func userNotificationCenter(_: UNUserNotificationCenter, willPresent _: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
|
|
func userNotificationCenter(_: UNUserNotificationCenter, willPresent _: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
|
|
logger.info("forground notification")
|
|
logger.info("forground notification")
|
|
- completionHandler([.alert, .sound])
|
|
|
|
|
|
+ if #available(iOS 14.0, *) {
|
|
|
|
+ completionHandler([.list, .badge])
|
|
|
|
+ } else {
|
|
|
|
+ completionHandler([.badge])
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
func userNotificationCenter(_: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
|
|
func userNotificationCenter(_: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
|