HTTP Transfers

FEATURES

  • Background Uploads & Downloads on each platform
  • Supports transfer filtering based on metered connections (iOS & UWP only at the moment)
  • Event Based Metrics
    • Percentage Complete
    • Total Bytes Expected
    • Total Bytes Transferred
    • Transfer Speed (Bytes Per Second)
    • Estimated Completion Time

SUPPORTED PLATFORMS

Platform Version
iOS 7+
Android 4.3+
Windows UWP 16299+
.NET Standard 2.0

SETUP

  1. Install the NuGet package - NuGet

  2. In your Shiny Startup - add the following


public override void ConfigureServices(IServiceCollection services)
{
    services.UseHttpTransfers<YourHttpTransferDelegate>();
}
  1. Implement a background delegate
public class YouHttpTransferDelegate : IHttpTransferDelegate
{
    // yes - you can inject anything registered with Shiny into the constructor here

    public void OnError(HttpTransfer transfer, Exception ex)
    {
    }


    public void OnCompleted(HttpTransfer transfer)
    {
    }
}
  1. Queue up an upload or download by injecting IHttpTransferManager into your viewmodel

public class YourViewModel
{
    public YouViewModel(IHttpTransferManager httpManager)
    {
        this.Download = new Command(async () =>
        {

        });

        this.Upload = new Command(async () => 
        {

        });
    }


    public ICommand Download { get; }
    public ICommand Upload { get; }
}
  1. Additional platform setup
GitHub