Getting Started

Platform Setup

Project NuGet MyGet
Core CoreNugetShield CoreMygetShield
Beacons BeaconsNugetShield BeaconsMygetShield
BluetoothLE BleNugetShield BleMygetShield
Locations LocationsNugetShield LocationsMygetShield
HTTP Transfers HttpNugetShield HttpMygetShield
Sensors SensorsNugetShield SensorsMygetShield
Notifications NotificationsNugetShield NotificationsMygetShield
SQLite Integration SqliteNugetShield SqliteMygetShield
AppCenter Logging Integration AppCenterNugetShield AppCenterMygetShield

Setup

  1. The first thing is to install any of the nuget packages you need from above.

  2. In your shared code project. Create a Shiny startup file:

using System;
using Microsoft.Extensions.DependencyInjection;
using Shiny;


namespace YourNamespace 
{
    public class YourShinyStartup : ShinyStartup
    {
        public override void ConfigureServices(IServiceCollection services) 
        {
            // this is where you'll load things like BLE, GPS, etc - those are covered in other sections
            // things like the jobs, environment, power, are all installed automatically
        }
    }
}

Android

  1. Create a new "MainApplication" in your Android head project.
using System;
using Android.App;
using Android.Runtime;

namespace YourNamespace.Droid
{
    [Application]
    public class MainApplication : Shiny.ShinyAndroidApplication<YourNamespace.YourShinyStartup>
    {
        public MainApplication(IntPtr handle, JniHandleOwnership transfer) : base(handle, transfer)
        {
        }
    }
}

IF you have an application file already, simple add the following to your OnCreate method

public override void OnCreate()
{
    base.OnCreate();

    Shiny.AndroidShinyHost.Init(
        this,
        new YourShinyStartup()
    );
}
  1. Add the following to your activity classes
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Permission[] grantResults)
{
    AndroidShinyHost.OnRequestPermissionsResult(requestCode, permissions, grantResults);
    base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
}

iOS

  1. In your ApplicationDelegate.cs, add the following in your FinishedLaunching method
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
    Shiny.iOSShinyHost.Init(new YourShinyStartup());
    ...
}

UWP

  1. Add the following to your App.xaml.cs constructor
Shiny.UwpShinyHost.Init(new YourStartup());
  1. Add the following to your Package.appxmanifest under the node
<Extension Category="windows.backgroundTasks" EntryPoint="Shiny.Support.Uwp.ShinyBackgroundTask">
    <BackgroundTasks>
        <Task Type="general"/>
        <Task Type="systemEvent"/>
        <Task Type="timer"/>
    </BackgroundTasks>
</Extension>

Tizen

COMING SOON

macOS

macOS, watchOS, & tvOS are not officially supported by Shiny yet, but will be in the future

Shiny Startup

Startup is the place where you wire up all of the necessary application depedencies you need

Out of the box, Shiny automatically pushes the following on to the service container

  • IEnvironment
  • IPowerManager
  • IJobManager
  • ISettings
GitHub