# 18. Implement iOS background sync service

meta:
  id: native-business-logic-migration-18
  feature: native-business-logic-migration
  priority: P1
  depends_on: [native-business-logic-migration-15]
  tags: [implementation, ios, background]

objective:
- Implement background feed sync using BGTaskScheduler

deliverables:
- BackgroundSyncService.swift
- SyncScheduler.swift
- SyncWorker.swift
- AppIntent extensions
- Background configuration

tests:
- Unit: Test scheduler configuration
- Unit: Test task cancellation
- Integration: Test background execution

acceptance_criteria:
- Background tasks scheduled properly
- Tasks execute within time window
- Battery-efficient scheduling
- Proper task cancellation
- State persisted between runs

validation:
- Test with Xcode debugger
- Verify with Console app logs

notes:
- Use BGAppRefreshTask
- Request background modes capability
- Handle time limits gracefully
