Get Started
Install Guides

C#

You can integrate the Ditto SDK into C# projects to develop for platforms, including mobile apps for iOS and Android, desktop apps, Linux-enabled server systems, and more.

To install the C# SDK:

1

Confirm that you meet the minimum requirements. (Prerequisites)

2

Install the Ditto SDK. (Installing Dependencies)

3

Set up your app permissions. (Configuring Permissions)

4

Add Ditto to your app. (Initializing Ditto)

Prerequisites

Following are the minimum requirements that must be met before attempting to install Ditto:

Installing Dependencies

Using either a compatible package manager, the .NET CLI, or by adding a reference to the package: CSProj.xml file, install the Ditto SDK by doing any of the following:

If using a package manager other than NuGet, the official package manager for .NET, the command syntax to install Ditto may differ from the following snippet. For more information, see the official Nuget documentation > Ditto .NET Standard.

NuGet Package Manager
.NET CLI
CSProj XML
Install-Package Ditto -Version 4.7.2

For the official .NET standard for Ditto, see the official NuGet reference at Packages > Ditto.

Configuring Permissions

To set up your environment for your target platform:

iOS Target
Android Target

For apps targeting iOS; for example, MAUI, once you've added the Ditto package dependency, configure permissions and ensure your app continues syncing while running in the background, including when the end-user device is locked, by enabling background modes.

1

Open the Info.Plist file for your project.

2

Add the following key-value pairs, and then, if desired, modify each string value:

XML

3

Enable Bluetooth Background Modes:

XML


Initializing Ditto

Once you’ve installed the Ditto SDK, set the debug level you want Ditto to log messages for, create a new Ditto identity, and set up Ditto exception handling for data sync operations:

C#


Next Steps

Learn how to build a task list app built on .NET Maui and integrated with Ditto by going to the MAUI Task App how-to tutorial.

Updated 27 Jun 2024
Did this page help you?