Getting Started

|Area|Info| |---|---| |Description|| |Service|Shiny.Jobs.IJobManager| |NuGet|| |Static Generated Class|ShinyJobs|

using Microsoft.Extensions.DependencyInjection;
using Shiny;

namespace YourNamespace
    public class YourShinyStartup : ShinyStartup
        public override void ConfigureServices(IServiceCollection services, IPlatform platform)

Minimum Version: 8.0


<?xml version="1.0" encoding="utf-8" ?>
<manifest xmlns:android="" android:versionCode="1" android:versionName="1.0" package="" android:installLocation="preferExternal">
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.BATTERY_STATS" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />

Minimum Version: 10


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 RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken) => this.ShinyRegisteredForRemoteNotifications(deviceToken); public override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error) => this.ShinyFailedToRegisterForRemoteNotifications(error); public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, Action<UIBackgroundFetchResult> completionHandler) => this.ShinyDidReceiveRemoteNotification(userInfo, completionHandler); } }


<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE plist PUBLIC " -//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">


<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE plist PUBLIC " -//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
   <string>development OR production</string>

No Special Configuration Required


  • Cross Platform Background Jobs Framework

  • Run adhoc jobs in the background (mainly for use on iOS)

  • Define jobs with runtime parameters to run at regular intervals

  • Internal logging to let you know how often jobs are running, if they complete successfully or error

  • Place criteria as to when jobs can run responsibly

    • device is charging
    • battery is not low
    • Internet connectivity via Mobile
    • Internet connectivity via WiFi
  • Running Adhoc One-Time Tasks

  • Scheduling Background Jobs

  • Cancelling Jobs

  • Running Jobs On-Demand

Creating a One-Time Adhoc Job

// To issue an adhoc task that can continue to run in the background 
CrossJobs.Current.RunTask(async () => 
    // your code

Scheduling a background job

// first define your job
public class YourJob : IJob
    public async Task Run(JobInfo jobInfo, CancellationToken cancelToken)
        var loops = jobInfo.GetValue("LoopCount", 25);

        for (var i = 0; i < loops; i++)
            if (cancelToken.IsCancellationRequested)

            await Task.Delay(1000, cancelToken).ConfigureAwait(false);
var job = new JobInfo
    Name = "YourJobName",
    Type = typeof(YourJob),

    // these are criteria that must be met in order for your job to run
    BatteryNotLow = this.BatteryNotLow,
    DeviceCharging = this.DeviceCharging
    NetworkType = NetworkType.Any,
    Repeat = true; //defaults to true, set to false to run once OR set it inside a job to cancel further execution

// you can pass variables to your job
job.SetValue("LoopCount", 10);

// lastly, schedule it to go - don't worry about scheduling something more than once, we just update if your job name matches an existing one

Cancelling Jobs

// Cancelling A Job

// Cancelling All Jobs

Running Jobs On-Demand

// Run All Jobs On-Demand
var results = await CrossJobs.Current.RunAll();

// Run A Specific Job On-Demand
var result = await CrossJobs.Current.Run("YourJobName");