Fix builds on macOS versions pre-11
authorClaudio Cambra <claudio.cambra@gmail.com>
Wed, 18 May 2022 14:33:11 +0000 (16:33 +0200)
committerClaudio Cambra <claudio.cambra@gmail.com>
Tue, 31 May 2022 09:10:17 +0000 (11:10 +0200)
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
src/gui/systray.mm

index e62d7125804958590db0d3e061b4d029b79f1951..516b4636e04b9e5afa90e957fb51bf8c5da3fed1 100644 (file)
@@ -18,7 +18,11 @@ Q_LOGGING_CATEGORY(lcMacSystray, "nextcloud.gui.macsystray")
     willPresentNotification:(UNNotification *)notification
     withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
 {
-    completionHandler(UNNotificationPresentationOptionSound + UNNotificationPresentationOptionBanner);
+    if (@available(macOS 11.0, *)) {
+        completionHandler(UNNotificationPresentationOptionSound + UNNotificationPresentationOptionBanner);
+    } else {
+        completionHandler(UNNotificationPresentationOptionSound + UNNotificationPresentationOptionAlert);
+    }
 }
 
 - (void)userNotificationCenter:(UNUserNotificationCenter *)center