BackgroundService

struct BackgroundService

A service for managing background tasks

Note

Background tasks are scheduled to run 15 minutes after the app is backgrounded.

Internal

  • Registers the background task with the system.

    Note

    This method should be called in the app delegate.

    Declaration

    Swift

    func scheduleTask()
  • Syncs favorite gauges from source, deletes gauge readings older than 30 days, and checks for alerts.

    Note

    This method is called by the background task scheduler and when a remote Push Notification is received.

    Note

    If notifications are not authorized, this method will not notify the user when the task is complete.

    Declaration

    Swift

    func syncFavorites()