Skip to main content

Extra: Diagnostics

Check the current SDK state during development.

Usage

Call getDiagnosticState from RookSamsung or RookSamsungObject to get the current diagnostic state.

val diagnosticState = rookSamsung.getDiagnosticState().getOrNull()
DO NOT USE IN PRODUCTION

getDiagnosticState is intended only to be used during the development phase of your app and should not be used in a production build.

The returned SHDiagnosticState has the following definition:

data class SHDiagnosticState(
val isConfigured: Boolean, // Indicates whether the SDK has been properly configured.
val userIdentified: Boolean, // Indicates whether a user has been successfully identified within the SDK.
val permissions: SHDiagnosticStatePermissions, // The current permissions status.
val backgroundSync: SHDiagnosticSyncState, // The current state and diagnostic information for background data synchronization.
val manualSync: SHDiagnosticSyncState, // The current state and diagnostic information for manual data synchronization.
)

enum class SHDiagnosticStatePermissions {
NOT_REQUESTED, // Permissions have not been requested.
REQUESTED, // Permission has been requested from the user but not yet decided or granted.
GRANTED, // Permission has been explicitly granted by the user.
}

data class SHDiagnosticSyncState(
// Indicates whether the diagnostic synchronization process is currently active (background) or has been triggered at least once (manual).
val enabled: Boolean,
// The Instant when the last synchronization was triggered, or null if it has never synced.
val lastSync: Instant?,
)