clearAll method

  1. @override
Future<bool> clearAll()
override

Clears all stored SDK data

This removes install ID, install data, first launch flag, event queue, and the active attribution context.

  • Returns: True if all removals were successful, false otherwise

Implementation

@override
Future<bool> clearAll() async {
  try {
    final results = await Future.wait([
      _prefs.remove(StorageKeys.installId),
      _prefs.remove(StorageKeys.installData),
      _prefs.remove(StorageKeys.firstLaunch),
      _prefs.remove(StorageKeys.eventQueue),
      _prefs.remove(StorageKeys.attribution),
    ]);

    // Return true only if all removals were successful
    return results.every((result) => result);
  } catch (e) {
    LinkFortyLogger.log('Failed to clear all data: $e');
    return false;
  }
}