> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ditto.live/llms.txt
> Use this file to discover all available pages before exploring further.

# .NET (C#) MAUI Quickstart

> Get started quickly with Ditto using the Ditto Quickstart Applications

export const QuickstartConfigTitleAndDatabaseIdBody = () => <div>
        <ol>
            <li>
                Log in to your <a href="https://portal.ditto.live" target="_blank">Ditto Portal account</a>
            </li>
            <li>
                Navigate to your database and obtain the Ditto <b>Database ID</b>, <b>Playground Token</b>, <b>Auth URL</b>, and <b>Websocket URL</b>.
                (see <a href="/cloud/portal/getting-sdk-connection-details">Getting SDK Connection Details</a> for more details)
            </li>
        </ol>
    </div>;

export const QuickstartSyncDataOfflineBody = () => <div>
        <ol>
            <li>Launch the application on multiple devices or simulators</li>
            <li>Disconnect from your current WiFi network while keeping WiFi enabled on the device to allow for LAN connections</li>
            <li>Add, edit, and delete tasks and experience offline collaboration!</li>
        </ol>
    </div>;

export const QuickstartCloneTheRepoBody = () => <div>
        <ol>
            <li>Open the terminal</li>
            <li>
                Clone the repository from GitHub.
                <pre>
                    <code>
                        git clone https://github.com/getditto/quickstart
                    </code>
                </pre>
            </li>
            <li>
                Navigate to the project directory:
                <pre>
                    <code>
                        cd quickstart
                    </code>
                </pre>
            </li>
        </ol>
    </div>;

## Prerequisites

Ditto’s .NET MAUI Quickstart supports **iOS**, **Android**, **Mac Catalyst** and **Windows**. Before getting started, ensure you
have the following:

* [Git](https://git-scm.com/) installed on your machine
* [.NET 10 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/10.0) or higher installed on your machine
* .NET MAUI workloads installed on your machine. From the project root, open a terminal and run:
  ```shell theme={null}
  sudo dotnet workload install maui
  sudo dotnet workload restore
  ```
* A Ditto [Portal](https://portal.ditto.live) account with a configured Ditto Database
  (see [Getting SDK Connection Details](/cloud/portal/getting-sdk-connection-details))

<AccordionGroup>
  <Accordion title="Android Specific Prerequisites" icon="android">
    - [Android Studio](https://developer.android.com/studio/install) installed on your machine
    - A physical Android device or Android emulator
  </Accordion>

  <Accordion title="iOS Specific Prerequisites" icon="apple">
    * A macOS machine with the latest version of [Xcode](https://developer.apple.com/xcode/) (16 or later) installed
    * A physical iOS device or iOS simulator
  </Accordion>

  <Accordion title="Mac Catalyst Specific Prerequisites" icon="apple">
    * A macOS machine with macOS 15 (Sequoia) or later
    * [Xcode](https://developer.apple.com/xcode/) 16 or later installed
  </Accordion>

  <Accordion title="Windows Specific Prerequisites" icon="windows">
    * A Windows machine running Windows 10 version 1809 (build 17763) or later
  </Accordion>
</AccordionGroup>

## Get Started

### 1. Clone the Repository

<QuickstartCloneTheRepoBody />

### 2. Configure Ditto

#### Get Ditto Database ID, Playground Token, Auth URL, and Websocket URL

<QuickstartConfigTitleAndDatabaseIdBody />

#### Add Ditto Credentials

1. Copy the `.env.sample` file at the top level of the `quickstart` repo to `.env` and add your app ID and online playground token.
   ```shell theme={null}
   cp .env.sample .env
   ```
2. Update the `.env` file with the Database ID and Playground Token from your Ditto Database
   ```shell theme={null}
   DITTO_APP_ID="REPLACE_ME_WITH_YOUR_DATABASE_ID"
   DITTO_PLAYGROUND_TOKEN="REPLACE_ME_WITH_YOUR_PLAYGROUND_TOKEN"
   DITTO_AUTH_URL="REPLACE_ME_WITH_YOUR_AUTH_URL"
   ```

### 3. Run the Application

1. Navigate to the project directory
   ```shell theme={null}
   cd dotnet-maui/DittoMauiTasksApp
   ```
2. Build and Run the Application

   <CodeGroup>
     ```shell Android theme={null}
     dotnet build -t:Run -f net10.0-android
     ```

     ```shell iOS theme={null}
     dotnet build -t:Run -f net10.0-ios
     ```

     ```shell Mac Catalyst theme={null}
     dotnet build -t:Run -f net10.0-maccatalyst
     ```

     ```shell Windows theme={null}
     dotnet build -t:Run -f net10.0-windows10.0.19041.0
     ```
   </CodeGroup>

### 4. Sync-Data Offline

<QuickstartSyncDataOfflineBody />

## Next Steps

All the Ditto Quickstart apps works together! Try running a quickstart app in other languages and see them all collaborate.

## Additional Resources

* [C# Install Guide](/sdk/latest/install-guides/c-sharp)
* [C# Release Notes](/sdk/latest/release-notes/c-sharp)
* [API Reference](/sdk/latest/api-reference/api-reference)
