Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions AmplitudeServiceKit/AmplitudeService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down Expand Up @@ -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() {
Expand Down