From 32679fd160912af5cf1511883210873060739dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=84=89=E1=85=A1=E1=86=BC=E1=84=92?= =?UTF-8?q?=E1=85=AA=E1=84=82=E1=85=B5=E1=86=B7/iOS=E1=84=8F=E1=85=B3?= =?UTF-8?q?=E1=86=AF=E1=84=85=E1=85=A1=E1=84=8B=E1=85=B5=E1=84=8B=E1=85=A5?= =?UTF-8?q?=E1=86=AB=E1=84=90=E1=85=B3=E1=84=80=E1=85=A2=E1=84=87=E1=85=A1?= =?UTF-8?q?=E1=86=AF=E1=84=90=E1=85=B5=E1=86=B7?= Date: Mon, 20 Nov 2023 13:27:18 +0900 Subject: [PATCH] =?UTF-8?q?[ADOTTPMTES-3984]=20TerminateApp,=20TerminateAp?= =?UTF-8?q?p=20notification=20=EC=97=90=20payload=20=EB=A5=BC=20=EC=95=B1?= =?UTF-8?q?=EC=AA=BD=EC=9C=BC=EB=A1=9C=20=EC=A0=84=EB=8B=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### 수정 내용 TerminateApp, TerminateApp 의 payload 는 자유 형식이며 앱단으로 전달만 함. --- .../CapabilityAgents/System/SystemAgent.swift | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/NuguAgents/Sources/CapabilityAgents/System/SystemAgent.swift b/NuguAgents/Sources/CapabilityAgents/System/SystemAgent.swift index 54a76a4b..fc7b11f1 100644 --- a/NuguAgents/Sources/CapabilityAgents/System/SystemAgent.swift +++ b/NuguAgents/Sources/CapabilityAgents/System/SystemAgent.swift @@ -167,7 +167,7 @@ private extension SystemAgent { self?.systemDispatchQueue.async { [weak self] in log.info("") - self?.post(NuguAgentNotification.System.TermiateApp(header: directive.header)) + self?.post(NuguAgentNotification.System.TermiateApp(header: directive.header, data: directive.payload)) } } } @@ -178,7 +178,7 @@ private extension SystemAgent { self?.systemDispatchQueue.async { [weak self] in log.info("") - self?.post(NuguAgentNotification.System.RequireUpdate(header: directive.header)) + self?.post(NuguAgentNotification.System.RequireUpdate(header: directive.header, data: directive.payload)) } } } @@ -256,22 +256,26 @@ public extension NuguAgentNotification { public struct TermiateApp: TypedNotification { static public var name: Notification.Name = .systemAgentDidReceiveTermiateApp public let header: Downstream.Header + public let data: Data public static func make(from: [String : Any]) -> TermiateApp? { - guard let header = from["header"] as? Downstream.Header else { return nil } + guard let header = from["header"] as? Downstream.Header, + let data = from["data"] as? Data else { return nil } - return TermiateApp(header: header) + return TermiateApp(header: header, data: data) } } public struct RequireUpdate: TypedNotification { static public var name : Notification.Name = .systemAgentDidReceiveRequireUpdate public let header: Downstream.Header + public let data: Data public static func make(from: [String : Any]) -> RequireUpdate? { - guard let header = from["header"] as? Downstream.Header else { return nil } + guard let header = from["header"] as? Downstream.Header, + let data = from["data"] as? Data else { return nil } - return RequireUpdate(header: header) + return RequireUpdate(header: header, data: data) } } }