Revert "Tie alerts attach the app icon explicitly"
This reverts commit b1889dacf5.
This commit is contained in:
committed by
FuelBoard Contributor
parent
b1889dacf5
commit
7d0a3645ee
@@ -261,19 +261,11 @@ final class ProximityMonitor: NSObject, ObservableObject, @preconcurrency CLLoca
|
|||||||
|
|
||||||
// Tie case: no map. A snapshot would only show one arbitrary station
|
// Tie case: no map. A snapshot would only show one arbitrary station
|
||||||
// (the primary), which is misleading — the user must pick from the
|
// (the primary), which is misleading — the user must pick from the
|
||||||
// action buttons. Deliver immediately with the choice buttons, and
|
// action buttons. Deliver immediately with the choice buttons.
|
||||||
// attach the app icon so the FuelBoard identity shows explicitly
|
|
||||||
// (the notification header icon is the container's inside
|
|
||||||
// LiveContainer, so the banner's right-hand thumbnail is the icon).
|
|
||||||
if !ties.isEmpty {
|
if !ties.isEmpty {
|
||||||
self.registerTieCategory(identifier: identifier, ties: ties)
|
self.registerTieCategory(identifier: identifier, ties: ties)
|
||||||
content.categoryIdentifier = "tie-\(identifier)"
|
content.categoryIdentifier = "tie-\(identifier)"
|
||||||
if let icon = Self.appIconAttachment() {
|
mapStatus?("map: none (tie — pick a station)")
|
||||||
content.attachments = [icon]
|
|
||||||
mapStatus?("map: none (tie) · icon: attached")
|
|
||||||
} else {
|
|
||||||
mapStatus?("map: none (tie — pick a station)")
|
|
||||||
}
|
|
||||||
UNUserNotificationCenter.current().add(
|
UNUserNotificationCenter.current().add(
|
||||||
UNNotificationRequest(identifier: identifier, content: content, trigger: nil)
|
UNNotificationRequest(identifier: identifier, content: content, trigger: nil)
|
||||||
)
|
)
|
||||||
@@ -373,17 +365,6 @@ final class ProximityMonitor: NSObject, ObservableObject, @preconcurrency CLLoca
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The app's own icon as a notification attachment, so the FuelBoard
|
|
||||||
/// identity shows explicitly even though the notification header icon is
|
|
||||||
/// the container's inside LiveContainer. Pulls the compiled
|
|
||||||
/// AppIcon60x60@2x.png straight from the bundle.
|
|
||||||
private static func appIconAttachment() -> UNNotificationAttachment? {
|
|
||||||
guard let url = Bundle.main.url(forResource: "AppIcon60x60@2x", withExtension: "png") else {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return try? UNNotificationAttachment(identifier: "icon", url: url, options: nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Fires a test alert built from REAL data: the cheapest station selling
|
/// Fires a test alert built from REAL data: the cheapest station selling
|
||||||
/// the monitored fuel within the configured alert radius of the current
|
/// the monitored fuel within the configured alert radius of the current
|
||||||
/// location — the same criteria a live geofence entry would apply, minus
|
/// location — the same criteria a live geofence entry would apply, minus
|
||||||
|
|||||||
Reference in New Issue
Block a user