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 for a complete overview of the platforms, transports, and devices, see the docid\ zoxgwk1yhgubssu0ne56e for the api reference, see https //software ditto live/dotnet/ditto/4 7 1/api reference/ to install the c# sdk confirm that you meet the minimum requirements ( /#prerequisites ) install the ditto sdk ( /#installing dependencies ) set up your app permissions ( /#configuring permissions ) add ditto to your app ( /#initializing ditto ) prerequisites following are the minimum requirements that must be met before attempting to install ditto https //learn microsoft com/en us/dotnet/standard/net standard?tabs=net standard 2 1#net standard versions https //dotnet microsoft com/en us/download/dotnet/3 0 https //dotnet microsoft com/en us/download/dotnet framework/net40 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 > https //www nuget org/packages/ditto/ install package ditto version 4 7 2 dotnet add package ditto version 4 7 2 \<packagereference include="ditto" version="4 7 2" /> for the official net standard for ditto, see the official nuget reference at packages > https //www nuget org/packages/ditto/ configuring permissions to set up your environment for your target platform 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 open the info plist file for your project add the following key value pairs, and then, if desired, modify each string value \<key>nsbluetoothalwaysusagedescription\</key> \<string>uses bluetooth to connect and sync with nearby devices\</string> \<key>nslocalnetworkusagedescription\</key> \<string>uses wifi to connect and sync with nearby devices\</string> \<key>nsbonjourservices\</key> \<array> \<string> http alt tcp \</string> \</array> enable bluetooth background modes \<key>uibackgroundmodes\</key> \<array> \<string>bluetooth central\</string> \<string>bluetooth peripheral\</string> \</array> for apps targeting android, once you've added the ditto package dependency, configure the necessary permissions open the androidmanifest xml file typically located in the src/main/ directory of your project add the necessary permissions to ensure your app has the permissions required by ditto for instructions on how to modify the following configuration for permissions requests; for example, prevent your app from requesting unnecessary permissions on newer os versions or ensure compatibility with both older and newer os versions, see docid\ jsinaqcwrgbzpeb lpaps \<manifest xmlns\ tools="http //schemas android com/tools" xmlns\ android="http //schemas android com/apk/res/android"> \<uses permission android\ name="android permission bluetooth" android\ maxsdkversion="30" /> \<uses permission android\ name="android permission bluetooth admin" android\ maxsdkversion="30" /> \<uses permission android\ name="android permission bluetooth advertise" tools\ targetapi="s" /> \<uses permission android\ name="android permission bluetooth connect" tools\ targetapi="s" /> \<uses permission android\ name="android permission bluetooth scan" android\ usespermissionflags="neverforlocation" tools\ targetapi="s" /> \<uses permission android\ name="android permission access fine location" android\ maxsdkversion="32" /> \<uses permission android\ name="android permission access coarse location" android\ maxsdkversion="30" /> \<uses permission android\ name="android permission internet" /> \<uses permission android\ name="android permission access wifi state" /> \<uses permission android\ name="android permission access network state" /> \<uses permission android\ name="android permission change network state" /> \<uses permission android\ name="android permission change wifi multicast state" /> \<uses permission android\ name="android permission change wifi state" /> \<uses permission android\ name="android permission nearby wifi devices" android\ usespermissionflags="neverforlocation" tools\ targetapi="tiramisu" /> customizing permissions to modify the behavior of permission requests for the android target features related to runtime permissions management for android is planned for future release add the following namespace attribute to the root \<manifest> tag of your androidmanifest xml file xmlns\ tools="http //schemas android com/tools" to request permissions on all os versions of android \<uses permission android\ name="android permission access fine location" tools\ remove="android\ maxsdkversion" /> \<uses permission android\ name="android permission access coarse location" tools\ remove="android\ maxsdkversion" /> to limit permissions request, use the following attributes as desired docid\ jsinaqcwrgbzpeb lpaps docid\ jsinaqcwrgbzpeb lpaps tools\ targetapi the tools\ targetapi attribute allows you to specify that a permission should only be requested on devices running a specified android api level or higher by limiting permissions requests, you prevent errors that result from asking permissions on devices running older os versions of android android\ maxsdkversion with the android\ maxsdkversion attribute, you can customize to only initiate a permission request on devices running a specified android api level or lower setting to a specified api level or lower helps avoids unnecessary permissions requests on devices running newer os versions of android 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 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}"); } next steps learn how to build a task list app built on net maui and integrated with ditto by going to the docid\ w sgefnbkqslarnjom tw how to tutorial