Permissions
You can integrate the Ditto SDK into C# projects to develop for a wide range of platforms.
For a complete overview of the platforms, transports, and devices the C# SDK supports, see C#.
To install the C# SDK:
Confirm that you meet the minimum requirements. (Prerequisites)
Prepare your environment for Ditto. (Setting Up Your Environment)
Set up your app permissions. (Setting Up Permissions)
Add Ditto to your app. (Integrating Ditto)
Following are the minimum requirements that must be met before attempting to install Ditto.
Using either the NuGet package manager, .NET CLI, or adding a reference to your .csproj XML file:
For the official .NET standard for Ditto, see the official NuGet reference at Packages > Ditto.
If developing for Android or iOS targets through frameworks like Xamarin.Forms and Multi-Platform App UI (MAUI), once you've integrated the Ditto dependency in your environment, configure your permissions as appropriate.
Xamarin is a Microsoft-developed framework for building cross-platform apps using C#. Building upon Xamarin's foundation, MAUI offers additional features and various cross‑platform development improvements. For more information, see Microsoft for the official Xamarin documentation.
Due to both Android and iOS limiting access to some device functionality for end‑user control and privacy by default, for Ditto to function optimally and use all the network transports — Bluetooth Low Energy (LE), Local Area Network, and so on — configure your app to automatically request all necessary permissions from end users at runtime by doing the following.
For more information on permissions requirements for Android OS, see the official Android documentation > Bluetooth permissions and Request permission to access nearby Wi-Fi.
Add the following permissions to your project's AndroidManifest.xml file:
The tools:targetAPI attribute ensures you avoid errors in older OS versions that do not recognize the permission.
The android:maxSdkVersion attribute ensures you avoid asking for more permissions than Ditto needs by preventing permission requests on devices running a newer OS version.
To opt out of this behavior, see step 2.
If you want to request permissions on all OS versions, regardless of API (tools:targetAPI) and SDK levels (tools:targetAPI), add the following to override the location permission option:
Features related to runtime permissions management for Android is planned for future release.
Integrate Ditto with your app:
For instructions on how to obtain your access credentials, see Get Started. For an introduction to authentication in Ditto, see Ditto Basics > Authentication and Initialization.