mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 16:42:44 +02:00
Add analytics for Unauthenticated errors
This commit is contained in:
@@ -83,7 +83,7 @@ import AnalyticsEvents
|
||||
|
||||
// Catch and log crashes
|
||||
MXLogger.logCrashes(true)
|
||||
MXLogger.setBuildVersion(AppDelegate.theDelegate().build)
|
||||
MXLogger.setBuildVersion(AppInfo.current.buildInfo.readableBuildVersion)
|
||||
}
|
||||
|
||||
/// Use the analytics settings from the supplied session to configure analytics.
|
||||
@@ -200,6 +200,16 @@ extension Analytics {
|
||||
}
|
||||
}
|
||||
|
||||
/// Track when a user becomes unauthenticated without pressing the `sign out` button.
|
||||
/// - Parameters:
|
||||
/// - reason: The error that occurred.
|
||||
/// - count: The number of times that error occurred.
|
||||
func trackAuthUnauthenticatedError(softLogout: Bool, refreshTokenAuth: Bool, errorCode: String, errorReason: String) {
|
||||
let errorCode = AnalyticsEvent.UnauthenticatedError.ErrorCode(rawValue: errorCode) ?? .M_UNKNOWN
|
||||
let event = AnalyticsEvent.UnauthenticatedError(errorCode: errorCode, errorReason: errorReason, refreshTokenAuth: refreshTokenAuth, softLogout: softLogout)
|
||||
client.capture(event)
|
||||
}
|
||||
|
||||
/// Track whether the user accepted or declined the terms to an identity server.
|
||||
/// **Note** This method isn't currently implemented.
|
||||
/// - Parameter accepted: Whether the terms were accepted.
|
||||
|
||||
Reference in New Issue
Block a user