Merge pull request #4563 from nextcloud/bugfix/pre-bigsur-build-fix

Fix build on macOS versions pre-11 (down to 10.14)
This commit is contained in:
Claudio Cambra 2022-05-31 11:37:08 +02:00 committed by GitHub
commit 87ebd3ff3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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