Shiny.NET
Getting Started

As developers, we often take internet connectivity and speed for granted. Mobile phones are taking HUGE sized photos these days that can take quite some time to upload.

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

|Area|Info| |---|---| |Description|| |Service|Shiny.Net.Http.IHttpTransferManager |NuGet|| |Static Generated Class|ShinyHttpTransfers

using Microsoft.Extensions.DependencyInjection;
using Shiny;

namespace YourNamespace
{
    public class YourShinyStartup : ShinyStartup
    {
        public override void ConfigureServices(IServiceCollection services, IPlatform platform)
        { 
            
<p>services.UseHttpTransfers&lt;Shiny.Net.Http.IHttpTransferDelegate&gt;();
services.UseHttpTransfers 
        }
    }
}

Minimum Version: 8.0

Minimum Version: 10

AppDelegate

using System;
using Foundation;
using Xamarin.Forms.Platform.iOS;
using Shiny;

namespace YourIosApp { [Register("AppDelegate")] public partial class AppDelegate : FormsApplicationDelegate { public override bool FinishedLaunching(UIApplication app, NSDictionary options) { this.ShinyFinishedLaunching(new Samples.SampleStartup()); global::Xamarin.Forms.Forms.Init(); this.LoadApplication(new Samples.App()); } public override void HandleEventsForBackgroundUrl(UIApplication application, string sessionIdentifier, Action completionHandler) => this.ShinyHandleEventsForBackgroundUrl(sessionIdentifier, completionHandler); } }

Info.plist

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE plist PUBLIC " -//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>

No Special Configuration Required

Setup

  1. Create a delegate in your shared code
using System;
using System.Threading.Tasks;
using Shiny;
using Shiny.Net.Http;

namespace YourNamespace
{
    public class MyHttpTransferDelegate : IHttpTransferDelegate
    {

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

        public async Task OnCompleted(HttpTransfer transfer)
        {
        }
    }
}

  1. Add the following to your Shiny Startup
using Microsoft.Extensions.DependencyInjection;
using Shiny;

namespace YourNamespace
{
    public class YourShinyStartup : ShinyStartup
    {
        public override void ConfigureServices(IServiceCollection services, IPlatform platform)
        { 
            
services.UseHttpTransfers<YourNamespace.MyHttpTransferDelegate>();
 
        }
    }
}