flushEvents method

Future<bool> flushEvents()

Manually triggers a flush of cached events to the server.

This method attempts to send all cached events to the SuperFCM backend. If the device is offline, the operation will fail silently and events will remain cached until the next flush attempt.

Example:

await SuperFCM.instance.flushEvents();

Implementation

Future<bool> flushEvents() async {
  return _queueOrExecute("flushEvents", () async {
    logger.d('Flushing cached events');
    bool result = await RequestManager.instance.flushCachedEvents();
    logger.d('Successfully flushed cached events');
    return result;
  });
}