background_runtime_ios

iOS implementation of the background_runtime Flutter plugin.

Uses Swift, Background URLSession, AVPlayer, and MPRemoteCommandCenter.

Supports iOS 15.0+.

Capabilities

  • Downloads: Background URLSession with download/resume task APIs. Progress callbacks via EventChannel.
  • Audio playback: AVPlayer (streaming, async). addPeriodicTimeObserver for drift-free progress. KVO on AVPlayerItem.status for ready/failed state.
  • Notifications: Control center / lock screen integration via MPNowPlayingInfoCenter with album art (MPMediaItemPropertyArtwork). MPRemoteCommandCenter handles Previous/Next/Play/Pause/Stop.
  • Notification actions: Command events mapped to NotificationAction enum and sent to Dart via notificationActionEvents EventChannel.
  • Permissions: Audio permission requested on main thread when enableAudio is enabled.