Notification links

This commit is contained in:
Garth Vander Houwen 2024-08-02 11:24:53 -07:00
parent f02926b43b
commit 8734b149c6
3 changed files with 5 additions and 5 deletions

View file

@ -712,10 +712,10 @@ func telemetryPacket(packet: MeshPacket, connectedNode: Int64, context: NSManage
Notification(
id: ("notification.id.\(UUID().uuidString)"),
title: "Critically Low Battery!",
subtitle: "AKA \(telemetry.nodeTelemetry?.user?.shortName ?? "UNK")",
subtitle: "\(telemetry.nodeTelemetry?.user?.longName ?? "unknown".localized)",
content: "Time to charge your radio, there is \(telemetry.batteryLevel)% battery remaining.",
target: "nodes",
path: "meshtastic:///nodes?nodenum=\(telemetry.nodeTelemetry?.num ?? 0)"
path: "meshtastic:///nodes?nodenum=\(telemetry.nodeTelemetry?.num ?? 0)&detail=deviceMetricsLog"
)
]
manager.schedule()

View file

@ -49,10 +49,10 @@ class MeshtasticAppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificat
if let targetValue = userInfo["target"] as? String,
let deepLink = userInfo["path"] as? String,
let url = URL(string: deepLink) {
Logger.services.info("userNotificationCenter didReceiveResponse \(targetValue) \(deepLink)")
Logger.services.info("🔔 userNotificationCenter didReceiveResponse \(targetValue) \(deepLink)")
router?.route(url: url)
} else {
Logger.services.error("Failed to handle notification response: \(userInfo)")
Logger.services.error("💥 Failed to handle notification response: \(userInfo)")
}
completionHandler()

View file

@ -188,7 +188,7 @@ func upsertNodeInfoPacket (packet: MeshPacket, context: NSManagedObjectContext)
subtitle: "\(newUser.longName ?? "unknown".localized)",
content: "New Node has been discovered",
target: "nodes",
path: "meshtastic:///nodes?nodenum=\(newUser.num)&detail=nodeMap"
path: "meshtastic:///nodes?nodenum=\(newUser.num)"
)
]
manager.schedule()