Skip to content

Commit

Permalink
✨ (CrashlyticsKit): Add CrashlyticsManager basic version
Browse files Browse the repository at this point in the history
  • Loading branch information
macteuts committed Nov 20, 2024
1 parent c1087c9 commit 8d68a44
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Modules/CrashlyticsKit/Sources/Manager/CrashlyticsManager.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
// Leka - iOS Monorepo
// Copyright APF France handicap
// SPDX-License-Identifier: Apache-2.0

import FirebaseCrashlytics

public class CrashlyticsManager {
// MARK: Lifecycle

private init() {
// Nothing to do
}

// MARK: Public

public static let shared = CrashlyticsManager()

public func log(message: String) {
Crashlytics.crashlytics().log(message)
}

public func setCustomKey(_ key: String, value: Any) {
Crashlytics.crashlytics().setCustomValue(value, forKey: key)
}

public func setUserID(_ userID: String) {
Crashlytics.crashlytics().setUserID(userID)
}

public func recordError(_ error: Error) {
Crashlytics.crashlytics().record(error: error)
}
}

0 comments on commit 8d68a44

Please sign in to comment.