mirror of
https://github.com/home-assistant/iOS.git
synced 2026-05-02 05:08:25 -05:00
Enable Notification Content extension on macOS 11+ (#1846)
Fixes #1592. ## Summary Enables the Notification Content extension now that it works in Xcode 13. ## Any other notes This is an entirely tooling enabling of this feature, as the extension works on macOS 11. There is a gotcha: the Notification Service Extension attachments are inaccessible. Additionally, macOS always displays the attached-by-us images/movies, which is a frustrating difference in behavior between macOS and iOS, but makes this particular deficiency less noticeable. Filed as FB9638431.
This commit is contained in:
@@ -63,8 +63,17 @@ class NotificationViewController: UIViewController, UNNotificationContentExtensi
|
||||
}
|
||||
|
||||
// Try to grab the attachments, in case they failed or were lazy
|
||||
let shouldDownload: Bool
|
||||
|
||||
if allowDownloads {
|
||||
if Current.isCatalyst {
|
||||
// catalyst doesn't have access to the system container for the builtin attachments
|
||||
// however, it _also_ shows the system preview image in all cases, so we don't need to for that too
|
||||
shouldDownload = attachmentURL == nil
|
||||
} else {
|
||||
shouldDownload = true
|
||||
}
|
||||
|
||||
if allowDownloads, shouldDownload {
|
||||
return firstly {
|
||||
Current.api
|
||||
}.then { api in
|
||||
|
||||
Reference in New Issue
Block a user