Skip to content

Commit

Permalink
Change payload key names
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Cunningham <[email protected]>
  • Loading branch information
digitaldan committed Jun 25, 2024
1 parent cc31873 commit 7be5a21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion NotificationService/NotificationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class NotificationService: UNNotificationServiceExtension {
// check if there is an attachment to put on the notification
// this should be last as we need to wait for media
// TODO: we should support relative paths and try the user's openHAB (local,remote) for content
if let attachmentURLString = userInfo["attachment-url"] as? String, let attachmentURL = URL(string: attachmentURLString) {
if let attachmentURLString = userInfo["media-attachment-url"] as? String, let attachmentURL = URL(string: attachmentURLString) {
os_log("handleNotification downloading %{PUBLIC}@", log: .default, type: .info, attachmentURLString)
downloadAndAttachMedia(url: attachmentURL) { attachment in
if let attachment {
Expand Down
4 changes: 2 additions & 2 deletions openHAB/OpenHABRootViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ class OpenHABRootViewController: UIViewController {
if action.hasPrefix("command") {
sendCommandAction(cmd)
}
} else if let navigate = userInfo["navigate"] as? String {
} else if let clickAction = userInfo["on-click"] as? String {
// the user simply clicked on the notification, but indicated a navigation in the payload
navigateCommandAction(navigate)
navigateCommandAction(clickAction)
}
}

Expand Down

0 comments on commit 7be5a21

Please sign in to comment.