Plugin.Maui.OfflineSync 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package Plugin.Maui.OfflineSync --version 1.0.3
                    
NuGet\Install-Package Plugin.Maui.OfflineSync -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Plugin.Maui.OfflineSync" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Plugin.Maui.OfflineSync" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="Plugin.Maui.OfflineSync" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Plugin.Maui.OfflineSync --version 1.0.3
                    
#r "nuget: Plugin.Maui.OfflineSync, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Plugin.Maui.OfflineSync@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Plugin.Maui.OfflineSync&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=Plugin.Maui.OfflineSync&version=1.0.3
                    
Install as a Cake Tool

Plugin.Maui.OfflineSync

NuGet

Offline-first data synchronization engine for .NET MAUI on iOS and Android.

Local writes are persisted immediately (SQLite by default), queued in a change log, and synchronized when the device is online. Conflicts are resolved with a built-in strategy or your own merger.

Install

Package: https://www.nuget.org/packages/Plugin.Maui.OfflineSync

dotnet add package Plugin.Maui.OfflineSync

Target frameworks:

  • net10.0 (unit tests / shared)
  • net10.0-android
  • net10.0-ios

Quick start

builder
    .UseMauiApp<App>()
    .UseOfflineSync(options =>
    {
        options.RemoteBaseAddress = new Uri("https://api.example.com/sync/");
        options.ConflictStrategy = ConflictStrategy.LastWriteWins;
        options.AutoSync = true;
        options.AutoSyncInterval = TimeSpan.FromMinutes(5);
    });
public sealed class TodoItem : SyncableEntity
{
    public string Title { get; set; } = "";
    public bool IsDone { get; set; }
}

var todos = OfflineSync.Default.GetCollection<TodoItem>("todos");
await todos.InsertAsync(new TodoItem { Title = "Buy milk" });
await OfflineSync.Default.SyncAsync();

InsertAsync / UpdateAsync / DeleteAsync always succeed locally. SyncAsync pushes the change log and pulls remote updates.

What you get

  • Local-first CRUD against SQLite (or an in-memory store)
  • Automatic change tracking with coalescing (edit-after-insert stays one insert)
  • Bidirectional sync with cursor-based incremental pull
  • Conflict strategies: last-write-wins, server-wins, client-wins, or custom
  • Network-aware auto-sync and optional OS background sync
  • Pluggable remote: HTTP, in-memory (tests/demos), or your own IRemoteSyncClient

HTTP protocol

HttpRemoteSyncClient uses a small conventional API.

Pull

GET {base}/{collection}?cursor={cursor}

{
  "items": [
    {
      "id": "abc",
      "version": 4,
      "updatedAtUtc": "2026-08-27T12:00:00Z",
      "isDeleted": false,
      "payloadJson": "{\"id\":\"abc\",\"title\":\"Buy milk\"}"
    }
  ],
  "cursor": "6389...",
  "serverTimeUtc": "2026-08-27T12:00:01Z"
}

Push

POST {base}/{collection}/changes

{
  "changes": [
    {
      "id": "abc",
      "operation": "insert",
      "baseVersion": 0,
      "updatedAtUtc": "2026-08-27T11:59:00Z",
      "payloadJson": "{\"id\":\"abc\",\"title\":\"Buy milk\"}"
    }
  ]
}

Response:

{
  "accepted": [{ "id": "abc", "version": 1, "updatedAtUtc": "2026-08-27T12:00:00Z" }],
  "conflicts": [],
  "rejected": []
}

A conflict should include the server document (serverVersion, serverUpdatedAtUtc, serverPayloadJson). The engine then applies IConflictResolver.

To supply your own transport:

builder.Services.AddSingleton<IRemoteSyncClient, MyApiClient>();

Background sync

Set EnableBackgroundSync = true.

Android — the package registers a JobScheduler job and requests RECEIVE_BOOT_COMPLETED. The host app should also declare that permission.

iOS — add the task identifier to Info.plist:

<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
  <string>plugin.maui.offlinesync.refresh</string>
</array>
<key>UIBackgroundModes</key>
<array>
  <string>fetch</string>
  <string>processing</string>
</array>

The identifier is OfflineSyncBackground.iOSTaskIdentifier.

Sample

samples/Plugin.Maui.OfflineSync.Sample is an iOS/Android todo app that writes to SQLite and syncs through an in-process remote. Toggle Offline to queue changes, then Sync now.

Pack

dotnet pack src/Plugin.Maui.OfflineSync/Plugin.Maui.OfflineSync.csproj -c Release

The .nupkg is written to artifacts/.

Support

If this plugin saved you a weekend of native plumbing, consider buying me a coffee. Your support keeps it maintained, documented, and free.

Buy Me A Coffee

This library stays open source. A coffee helps cover time for bug fixes, new features, and docs.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-android36.0 is compatible.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-ios26.0 is compatible.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Plugin.Maui.OfflineSync:

Package Downloads
Plugin.Maui.Observability

Umbrella telemetry pipeline for .NET MAUI on iOS and Android. Unifies AppHealth, NetworkMonitor, ApiResilience, BackgroundTasks, OfflineSync, SmartUpload, and DeviceSession into one signal stream, and exports to OpenTelemetry, Application Insights, Sentry, Datadog, Console, or a custom HTTP endpoint.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.9 88 9/2/2026
1.0.8 90 8/30/2026
1.0.7 100 8/30/2026
1.0.6 91 8/29/2026
1.0.5 91 8/28/2026
1.0.4 105 8/28/2026
1.0.3 101 8/28/2026
1.0.2 94 8/28/2026
1.0.1 100 8/27/2026
1.0.0 88 8/27/2026