> For the complete documentation index, see [llms.txt](https://docs.digia.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digia.tech/digia-engage/developer-guides/debug-settings-deeplink.md).

# SDK Debug Settings

The Digia Engage SDK includes a debug settings screen for development and QA builds. This screen gives you access to SDK-side tools such as **Sync**, **Live test** connection status, the Digia bubble, recording mode, and other debugging utilities that may be added over time.

You need this screen when you want to:

* connect a debug device to the Digia Engage dashboard
* enable Sync for live campaign testing
* sync pages, anchors, and slots with the Digia Engage dashboard

After Sync sends pages, anchors, and slots to the dashboard, campaign creators can review them in [Component Registry](/digia-engage/user-guides/component-registry.md).

{% hint style="warning" %}
The SDK debug settings screen is available only in debug builds. Release builds do not open this screen from a deep link or from `openDebugSettings`.
{% endhint %}

## Open From Your Own Settings Screen

If your app already has an internal developer menu, QA menu, or app settings screen, add a button that calls the SDK directly:

```
Digia.openDebugSettings(...)
```

This is useful when your QA team already has a known place to access internal tools. It follows the same debug-build rule: release builds will not open the SDK debug settings screen.

## If You Do Not Have Deep Links Yet

Set up deep linking with the platform documentation your app already follows:

| Platform     | Start here                                                                                                                                                                                                                   |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Android      | [Android deep links](https://developer.android.com/training/app-links/deep-linking)                                                                                                                                          |
| iOS          | [Custom URL schemes](https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app) or [Universal Links](https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app) |
| Flutter      | [Flutter deep linking](https://docs.flutter.dev/ui/navigation/deep-linking)                                                                                                                                                  |
| React Native | [React Native Linking](https://reactnative.dev/docs/linking)                                                                                                                                                                 |
| Expo         | [Linking into an Expo app](https://docs.expo.dev/linking/into-your-app/)                                                                                                                                                     |

After your app can receive a test link, add the platform-specific Digia handling below.

## Android

No integration is required for the default Android debug link.

The Digia Engage Android SDK registers its own debug settings entry point, so the dashboard can open SDK debug settings on Android debug builds without any app-side deep link code.

Use this URI to open the screen directly:

```
digia-engage://_digia/debug-settings
```

{% hint style="info" %}
If you also want your own app scheme, such as `acmeapp://_digia/debug-settings`, to open SDK debug settings on Android, route that link to your Activity and pass it to Digia from your existing handler.
{% endhint %}

## iOS

Add the Digia check inside your existing URL handler.

{% tabs %}
{% tab title="AppDelegate" %}

```swift
func application(
  _ app: UIApplication,
  open url: URL,
  options: [UIApplication.OpenURLOptionsKey: Any] = [:]
) -> Bool {
  if url.absoluteString.hasSuffix(Digia.debugSettingsDeepLinkPath) {
    Digia.handleDeepLink(url, from: rootViewController)
    return true
  }

  return handleAppDeepLink(url)
}
```

{% endtab %}

{% tab title="SwiftUI" %}

```swift
.onOpenURL { url in
  if url.absoluteString.hasSuffix(Digia.debugSettingsDeepLinkPath) {
    Digia.handleDeepLink(url, from: rootViewController)
    return
  }

  handleAppDeepLink(url)
}
```

{% endtab %}
{% endtabs %}

Use the app's existing scheme or universal link:

```
yourScheme://_digia/debug-settings
```

When a dashboard user selects iOS in **Test & Debug**, they enter this scheme so the QR can open your app.

## Flutter

If your Flutter app already uses a deep link package or router, add the Digia check inside your existing deep link listener.

Use your app's existing scheme with the Digia settings route:

```
yourScheme://_digia/debug-settings
```

```dart
if (Digia.isDebugSettingsDeepLink(uri)) {
  Digia.openDebugSettings(navigatorKey.currentContext!);
  return;
}
```

`navigatorKey` should be the same `GlobalKey<NavigatorState>` passed to `MaterialApp`.

## React Native

### Android

No integration is required for the default Android debug link.

The Digia Engage Android SDK registers its own debug settings entry point, so React Native Android apps can use the dashboard QR flow without extra JS routing.

Use this URI to open the screen directly:

```
digia-engage://_digia/debug-settings
```

### iOS

If your React Native app has a native `AppDelegate.swift` that is not regenerated by your build tooling, add the iOS native handler in [iOS](#ios).

If your app uses React Navigation, Expo Router, or another JS router that already owns deep links, add the Digia route to that existing routing setup.

For a raw `Linking` setup, handle both warm links and cold-start links:

```ts
import { Linking } from 'react-native';
import { Digia } from '@digia-engage/core';

const handleUrl = (url: string) => {
  if (url.endsWith(Digia.debugSettingsDeepLinkPath)) {
    Digia.handleDeepLink(url);
    return;
  }

  handleAppDeepLink(url);
};

Linking.addEventListener('url', ({ url }) => handleUrl(url));
Linking.getInitialURL().then((url) => {
  if (url) handleUrl(url);
});
```

For Expo Router, create a route that matches the Digia path:

```tsx
// app/_digia/debug-settings.tsx
import { useEffect } from 'react';
import { Digia } from '@digia-engage/core';

export default function DigiaDebugSettingsRoute() {
  useEffect(() => {
    Digia.openDebugSettings();
  }, []);

  return null;
}
```

## Test The Setup

Test the setup on a debug build.

For a real phone:

1. Open your project in the Digia Engage dashboard.
2. Go to **Test & Debug**.
3. Select the platform you want to test.
4. For iOS, enter your app scheme, such as `acmeapp`.
5. Open the phone camera and scan the QR code shown in the dashboard.
6. Tap **Open app**.

If the SDK debug settings screen opens, setup is complete.

For an emulator or simulator, open the link directly:

| Platform             | Example                                |
| -------------------- | -------------------------------------- |
| Android              | `digia-engage://_digia/debug-settings` |
| iOS                  | `yourScheme://_digia/debug-settings`   |
| Flutter              | `yourScheme://_digia/debug-settings`   |
| React Native Android | `digia-engage://_digia/debug-settings` |
| React Native iOS     | `yourScheme://_digia/debug-settings`   |

If the link opens your app but not the SDK debug settings screen, confirm that:

1. The app's deep link handler receives the URL.
2. The Digia check runs before the app's normal navigation fallback.
3. The URL ends with `_digia/debug-settings`.
4. You are testing a debug build.
5. The SDK version includes the debug settings screen.
