Skip to main content

Installation

Compatibility

Currently, the C# SDK runs on iOS, macOS, Windows, and Linux. Peer to peer capabilites of the C# SDK vary by platform. All platforms can connect to other Ditto instances over a local LAN via WiFi. iOS and macOS can connect to each other over Bluetooth LE and WiFi Direct (AWDL). See below for Xamarin support.

LANWiFi DirectBluetooth
iOS
macOS
Windowsxx
Linuxxx
Androidxxx

Setup

The C# SDK is available as part of NuGet. The common ways to install the SDK is with either the NuGet Package Manager, the .NET CLI, or by adding a reference to the CSProj XML file.

Install-Package Ditto -Version 4.7.0

For more installation options visit the NuGet Page

Now in your code you can call:

try{    DittoLogger.SetMinimumLogLevel(DittoLogLevel.Debug);    var ditto = new Ditto(DittoIdentity.OnlinePlayground("REPLACE_ME_WITH_YOUR_APP_ID", "REPLACE_ME_WITH_YOUR_PLAYGROUND_TOKEN", true), path);    ditto.StartSync();}catch (DittoException ex){    Console.WriteLine($"Ditto Error {ex.Message}");}
var docId = ditto.Store.Collection("people").Upsert(    new Dictionary<string, object> {    { "name", "Susan" },    { "age", 31 },    });

Xamarin

info

Xamarin.iOS is currently supported on physical devices, however the iOS simulator is not supported yet. Xamarin.Android support is coming soon.

Follow the Xamarin tutorial to build your first Tasks application with Ditto.

New and Improved Docs

Ditto has a new documentation site at https://docs.ditto.live. This legacy site is preserved for historical reference, but its content is not guaranteed to be up to date or accurate.