Skip to content

Commit

Permalink
Add missing public calls to new TelemetryDeck domain name
Browse files Browse the repository at this point in the history
This streamlines migration and fixes #171.
  • Loading branch information
Jeehut committed Jul 19, 2024
1 parent 2efcd23 commit f698a04
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/TelemetryClient/TelemetryClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ public class TelemetryManager {
/// Shuts down the SDK and deinitializes the current `TelemetryManager`.
///
/// Once called, you must call `TelemetryManager.initialize(with:)` again before using the manager.
@available(*, deprecated, renamed: "TelemetryDeck.terminate()", message: "This call was renamed to `TelemetryDeck.terminate()`. Please migrate – a fix-it is available.")
public static func terminate() {
initializedTelemetryManager = nil
}
Expand Down Expand Up @@ -259,6 +260,7 @@ public class TelemetryManager {
///
/// Note that just as with specifying the user identifier with the `send` call, the identifier will never leave the device.
/// Instead it is used to create a hash, which is included in your signal to allow you to count distinct users.
@available(*, deprecated, renamed: "TelemetryDeck.updateDefaultUserID(to:)", message: "This call was renamed to `TelemetryDeck.updateDefaultUserID(to:)`. Please migrate – a fix-it is available.")
public static func updateDefaultUser(to newDefaultUser: String?) {
TelemetryManager.shared.updateDefaultUser(to: newDefaultUser)
}
Expand All @@ -268,6 +270,7 @@ public class TelemetryManager {
}

/// Generate a new Session ID for all new Signals, in order to begin a new session instead of continuing the old one.
@available(*, deprecated, renamed: "TelemetryDeck.generateNewSession()", message: "This call was renamed to `TelemetryDeck.generateNewSession()`. Please migrate – a fix-it is available.")
public static func generateNewSession() {
TelemetryManager.shared.generateNewSession()
}
Expand Down
25 changes: 25 additions & 0 deletions Sources/TelemetryClient/TelemetryDeck.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,29 @@ public enum TelemetryDeck {
public static func requestImmediateSync() {
TelemetryManager.requestImmediateSync()
}

/// Shuts down the SDK and deinitializes the current `TelemetryManager`.
///
/// Once called, you must call `TelemetryManager.initialize(with:)` again before using the manager.
public static func terminate() {
TelemetryManager.terminate()
}

/// Change the default user identifier sent with each signal.
///
/// Instead of specifying a user identifier with each `signal` call, you can set your user's name/email/identifier here and
/// it will be sent with every signal from now on. If you still specify a user in the `signal` call, that takes precedence.
///
/// Set to `nil` to disable this behavior.
///
/// Note that just as with specifying the user identifier with the `signal` call, the identifier will never leave the device.
/// Instead it is used to create a hash, which is included in your signal to allow you to count distinct users.
public static func updateDefaultUserID(to customUserID: String?) {
TelemetryManager.updateDefaultUser(to: customUserID)
}

/// Generate a new Session ID for all new Signals, in order to begin a new session instead of continuing the old one.
public static func generateNewSession() {
TelemetryManager.generateNewSession()
}
}

0 comments on commit f698a04

Please sign in to comment.