Skip to content

Commit

Permalink
[ADOTTPMTES-3984] TerminateApp, TerminateApp notification 에 payload 를…
Browse files Browse the repository at this point in the history
… 앱쪽으로 전달

### 수정 내용
TerminateApp, TerminateApp 의 payload 는 자유 형식이며 앱단으로 전달만 함.
  • Loading branch information
이상화님/iOS클라이언트개발팀 authored and jayce1116 committed Nov 20, 2023
1 parent 927dcd9 commit 32679fd
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions NuguAgents/Sources/CapabilityAgents/System/SystemAgent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
}
Expand All @@ -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))
}
}
}
Expand Down Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit 32679fd

Please sign in to comment.