Shiny.Net.Http: Background File Transfers for Mobile .NET Apps
Shiny.Net.Http is a library that keeps file uploads and downloads running in the background on iOS, Android and other platforms, even when the app is suspended or killed. Its queue survives restarts and supports retries, pause and resume. It is a practical alternative to hand-written retry loops for mobile teams.
Key points
- Register with AddHttpTransfers<T>() and implement an HttpTransferDelegate to handle completion and retry behavior
- The queue is persisted, so transfers continue after the app is suspended or killed
- Transfers wait in PausedByNoNetwork when offline; set UseMeteredConnection = false to keep large files off mobile data
- OnAuthorizationFailed lets you refresh a bearer token and re-queue the transfer without losing it
- HttpTransferMonitor.Transfers is a bindable collection of INotifyPropertyChanged objects for XAML views
- AddTransferProgress surfaces progress on the iOS Lock Screen and in Android foreground notifications
Mobile apps often lose file uploads when the user switches away, because iOS suspends the app and takes the HttpClient socket with it. Shiny.Net.Http tries to solve this by handing the transfer to the platform's background machinery. The library began in 2016 as a Xamarin plugin and now runs on MAUI, Windows, Linux, macOS and Blazor WebAssembly, with an API that has stayed largely stable through rewrites.
In practice you register the services, queue a request describing the endpoint and file, and subclass a transfer delegate to react when a job finishes. Queued work is persisted, so it resumes after the process dies. Network loss moves transfers into a paused state, downloads can resume with Range requests, and resumable uploads use tus. A monitor exposes observable transfer objects that bind to a UI, and a separate module pushes progress to the iOS Lock Screen or the Android notification. The author's full walkthrough is in the original post.
Real-world use
- A field-inspection app uploading photos and signed PDFs over a weak cellular connection
- A delivery app sending proof-of-delivery images in the background while the driver moves on
- A MAUI app downloading a large offline map or on-device AI model with resume after interruptions
Why it matters
For MAUI teams, moving transfers to the OS-backed queue removes a lot of hand-written retry and suspension handling. Knowing the queue semantics and the monitor API up front avoids surprises in production.
Related stories
- Collection Return Types in C#: Interfaces, Views, and SnapshotsNick Cosentino (Dev Leader)2 d ago
- Idempotent NebulaGraph bulk ingestion from .NET using deterministic VIDsDEV Community: #csharp3 d ago
- Events and Delegates in C#: Contracts, Subscriptions and NotificationNick Cosentino (Dev Leader)3 d ago