setAppForegroundState function

void setAppForegroundState(
  1. bool isForeground
)

Sets the foreground state of the app. When in the foreground, the mesh engine aggressively scans for peers.

Implementation

void setAppForegroundState(bool isForeground) {
  _log('App foreground state changed: $isForeground');
  _isAppForeground = isForeground;
  if (isForeground) {
    triggerImmediateSync();
  }
}