From f73cbb5d8011bbb06d3b50421db4e9f291fdb82b Mon Sep 17 00:00:00 2001 From: Nathaniel Hamming Date: Tue, 19 Sep 2023 06:10:41 -0300 Subject: [PATCH] [COASTAL-1291] update for pluggable protocol (#16) --- AmplitudeServiceKit/AmplitudeService.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/AmplitudeServiceKit/AmplitudeService.swift b/AmplitudeServiceKit/AmplitudeService.swift index 673d06c..1d38514 100644 --- a/AmplitudeServiceKit/AmplitudeService.swift +++ b/AmplitudeServiceKit/AmplitudeService.swift @@ -11,11 +11,13 @@ import LoopKit public final class AmplitudeService: Service { - public static let serviceIdentifier = "AmplitudeService" + public static let pluginIdentifier = "AmplitudeService" public static let localizedTitle = LocalizedString("Amplitude", comment: "The title of the Amplitude service") public weak var serviceDelegate: ServiceDelegate? + + public weak var stateDelegate: StatefulPluggableDelegate? public var apiKey: String? @@ -44,12 +46,12 @@ public final class AmplitudeService: Service { public func completeUpdate() { try! KeychainManager().setAmplitudeAPIKey(apiKey) createClient() - serviceDelegate?.serviceDidUpdateState(self) + stateDelegate?.pluginDidUpdateState(self) } public func completeDelete() { try! KeychainManager().setAmplitudeAPIKey() - serviceDelegate?.serviceWantsDeletion(self) + stateDelegate?.pluginWantsDeletion(self) } private func createClient() {