From 7be5a21b03c1c8f44341d5035ec7ffc407328ecb Mon Sep 17 00:00:00 2001 From: Dan Cunningham Date: Mon, 24 Jun 2024 21:53:54 -0700 Subject: [PATCH] Change payload key names Signed-off-by: Dan Cunningham --- NotificationService/NotificationService.swift | 2 +- openHAB/OpenHABRootViewController.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NotificationService/NotificationService.swift b/NotificationService/NotificationService.swift index 8d91e5bd..19c40cb8 100644 --- a/NotificationService/NotificationService.swift +++ b/NotificationService/NotificationService.swift @@ -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 { diff --git a/openHAB/OpenHABRootViewController.swift b/openHAB/OpenHABRootViewController.swift index 28ade986..ee069889 100644 --- a/openHAB/OpenHABRootViewController.swift +++ b/openHAB/OpenHABRootViewController.swift @@ -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) } }