Feature 3.6 Daniel Clavijo - ISIS3510-MOBILE-T34/T34-Wiki-SpendiQ GitHub Wiki
Application Features Overview - iOS Implementation
Local Storage
FileManager
- Purpose: Stores temporary image attachments for notifications.
- Benefit: Efficiently manages local file storage for notification images and attachments.
UserDefaults
- Purpose: Stores notified offer IDs to prevent duplicate notifications.
- Benefit: Provides lightweight persistence for tracking user interactions with offers.
Firestore Offline Persistence
- Purpose: Caches Firestore data for offline access.
- Benefit: Ensures data availability even when network connectivity is limited.
Multi-Threading
OperationQueue
- Context: Implemented in
OffersDistanceOperation
.
- Purpose: Handles CPU-intensive distance calculations between user location and offers.
- Benefit: Prevents UI blocking during complex calculations by running them in background threads.
Async/Await Operations
- Context: Used in
DataService
for network operations.
- Purpose: Manages asynchronous Firestore operations and data processing.
- Benefit: Provides clean, modern concurrency handling with improved error management.
Background Tasks
- LocationManager: Monitors user location changes in the background.
- ProximityTimer: Checks nearby offers every 20 seconds.
- Benefit: Maintains real-time location awareness without impacting app performance.
Caching
NSCache
- Context: Implemented in
EnhancedDataService
.
- Purpose: Caches fetched offers to reduce database queries.
- Benefit: Improves performance and reduces network usage by storing frequently accessed data.
Location Data Buffering
- Context: Used in location updates processing.
- Purpose: Implements debounce mechanism for location updates.
- Benefit: Prevents excessive processing of rapid location changes.
Eventual Connectivity
Firebase Offline Support
- Purpose: Handles database operations during network interruptions.
- Benefit: Ensures app functionality continues during connectivity issues.
Background Operations
- Purpose: Manages offer notifications and calculations during poor connectivity.
- Benefit: Maintains core functionality even with unstable network conditions.