Skip to main content

Extra: Diagnostics

Check the current SDK state during development.

Usage

Call getDiagnosticState from RookSamsung to get the current diagnostic state.

void example() async {
try {
final diagnosticState = await RookSamsung.getDiagnosticState();

// Log diagnostic state
} catch (error) {
// Handle error
}
}
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 DiagnosticState has the following definition:

final class DiagnosticState {
final bool isConfigured; // Indicates whether the SDK has been properly configured.
final bool userIdentified; // Indicates whether a user has been successfully identified within the SDK.
final DiagnosticStatePermissions permissions; // The current permissions status.
final DiagnosticSyncState backgroundSync; // The current state and diagnostic information for background data synchronization.
final DiagnosticSyncState manualSync; // The current state and diagnostic information for manual data synchronization.
}

enum DiagnosticStatePermissions {
notRequested, // 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.
}

final class DiagnosticSyncState {
// Indicates whether the diagnostic synchronization process is currently active (background) or has been triggered at least once (manual).
final bool enabled;
// The DateTime when the last synchronization was triggered, or null if it has never synced.
final DateTime? lastSync;
}