Fix building on older macOS SDKs

This commit is contained in:
Kovid Goyal 2021-11-20 04:42:01 +05:30
parent d6949a7a3c
commit 19e653ef1b
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -226,11 +226,8 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center
willPresentNotification:(UNNotification *)notification
withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler {
UNNotificationPresentationOptions options = UNNotificationPresentationOptionSound;
#if MAC_OS_X_VERSION_MAX_ALLOWED < 110000
options |= UNNotificationPresentationOptionAlert;
#else
options |= UNNotificationPresentationOptionList | UNNotificationPresentationOptionBanner;
#endif
if(@available(macOS 11.0, *)) options |= UNNotificationPresentationOptionList | UNNotificationPresentationOptionBanner;
else options |= UNNotificationPresentationOptionAlert;
completionHandler(options);
}