setLastFcmCaptureAttemptAtForTesting method

  1. @visibleForTesting
Future<void> setLastFcmCaptureAttemptAtForTesting(
  1. DateTime? value
)

Test seam (D9-iv): WRITES THROUGH to the persisted D2 store so the backoff-elapsed→retry boundary is testable without a real ~15-minute wait. Pass null to clear it.

Implementation

@visibleForTesting
Future<void> setLastFcmCaptureAttemptAtForTesting(DateTime? value) async {
  final prefs = await SharedPreferences.getInstance();
  if (value == null) {
    await prefs.remove(_lastFcmCaptureAttemptAtKey);
  } else {
    await prefs.setInt(
        _lastFcmCaptureAttemptAtKey, value.millisecondsSinceEpoch);
  }
}