For the official .NET standard for Ditto, see the official NuGet reference at Packages > Ditto.
Permissions Configurations
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.
Setting Up Permissions
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.
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.
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.
1
From your Info.Plist file, add the following key-value pairs, and then, if applicable, modify each string assigned to Value:
Once implemented, the following string values display as a prompt to your end users explaining why the app requires certain permissions.
If your end users prefer a language other than English, replace the string values with their language equivalents or use localized strings.
XML
<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>
2
Ensure uninterrupted syncing, by enabling Bluetooth Background Modes in your Info.Plist file.
Once enabled, you ensure your app continuously runs in the background, even when the end-user's device is locked.
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.