Notifications & Background Sync

Sync architecture

MonoMail uses two sync mechanisms:

  1. Foreground polling — every ~2 minutes when the app is visible (lifecycle-aware)
  2. Background sync — via WorkManager at the configured interval (15 min / 30 min / 1 hour / Manual)

When the app goes to background, a quick adaptive sync is scheduled with a 1-minute delay.

Push notifications

BuildPush method
Play StoreFirebase Cloud Messaging (FCM). The push relay server (Cloudflare Workers) forwards notifications from Gmail/Outlook webhooks.
GitHubPush is disabled (no FCM configured). Relies on periodic WorkManager polling.

Notification content

Each notification shows:

Notification actions

ActionDescription
Inline replyReply directly from the notification shade via RemoteInput
ArchiveArchive the thread from the notification
UndoAfter archiving, a follow-up notification offers undo

Per-account settings

Configure sound and vibration per account. Each account gets its own notification channel on Android 8+.

How often does the app sync?

StateInterval
Foreground (app visible)Every ~2 minutes
BackgroundAt the interval set in Settings → Notifications → Sync Frequency (default 15 min)
After push notificationImmediately (Play Store build only)
After closing the appQuick sync with 1-minute delay
← PGP Encryption Settings →