# Quick start

> Install the Grovs Unity package, fill in Project Settings and open your first link on a device.

Source: https://docs.grovs.io/docs/sdk/unity/quick-start

Install the package, fill in Project Settings and open your first link on a device. Takes about fifteen minutes.

**Using an AI coding agent?**

Copy one prompt into Claude Code, Cursor or Copilot and it does these steps in your project.

```text
Add Grovs deep linking to this Unity game (example app: Medly).

1. Check that External Dependency Manager for Unity (com.google.external-dependency-manager) is installed. If not, add it from OpenUPM.
2. Add "com.grovs.sdk": "https://github.com/grovs-io/grovs-unity.git#upm/v1.0.0" to Packages/manifest.json.
3. In Assets → External Dependency Manager → iOS Resolver → Settings, turn on "Add pods to Unity framework target" and "Link frameworks statically".
4. Create Assets/Grovs/GrovsSettings.asset through Edit → Project Settings → Grovs. Leave the API key, URI scheme and link domains for me to fill in from the Grovs dashboard.
5. In the first scene, subscribe to Grovs.DeeplinkReceived (namespace GrovsSDK) and route GrovsDeeplink.Data to the existing scene loading code. There is no init call.
6. Check Player Settings → Android → Target API Level is 34 or higher. Build both platforms, then list what you changed.

Docs: https://docs.grovs.io/docs/sdk/unity/quick-start.md
```

## Requirements

- Unity 2022.3 or newer (Unity 6 included). Mono and IL2CPP, with or without Android minify.
- iOS 13.0+.
- Android target API level 34 or higher. The build fails below 34.
- [External Dependency Manager for Unity](https://github.com/googlesamples/unity-jar-resolver) (EDM4U). It pulls in the native SDKs.
- Your bundle ID, Apple Team ID, package name and SHA-256 signing fingerprints registered in the Grovs dashboard. See [Dashboard setup](#dashboard-setup).

## Installation

### 1. Install EDM4U

Install it from [OpenUPM](https://openupm.com/packages/com.google.external-dependency-manager/) or from [its GitHub releases](https://github.com/googlesamples/unity-jar-resolver). Without it, Grovs logs `Grovs needs External Dependency Manager for Unity` once per Editor session.

### 2. Add the Grovs package

**Git URL**

In **Window → Package Manager**, click **+ → Add package from git URL** and enter:

```text
https://github.com/grovs-io/grovs-unity.git#upm/v1.0.0
```

Or add it to `Packages/manifest.json`:

```json
{
  "dependencies": {
    "com.grovs.sdk": "https://github.com/grovs-io/grovs-unity.git#upm/v1.0.0"
  }
}
```

Use a `upm/vX.Y.Z` tag, not the main branch. Only the `upm` branch holds the prebuilt Android bridge libraries.

**OpenUPM**

```bash
openupm add com.grovs.sdk
```

**.unitypackage**

Download `Grovs-1.0.0.unitypackage` from the [GitHub release](https://github.com/grovs-io/grovs-unity/releases) and import it with **Assets → Import Package → Custom Package**.

The package pins the native SDKs: CocoaPods `Grovs ~> 3.1` and Maven `io.grovs:Grovs:[3.1.0,3.2)`. Don't add them yourself.

### 3. Check the EDM4U settings

Open **Assets → External Dependency Manager → iOS Resolver → Settings** and check:

- **Add pods to Unity framework target**: on. The Grovs bridge lives in `UnityFramework`, so the pod must be linked there.
- **Link frameworks statically**: on (the default).

On Android, run **Assets → External Dependency Manager → Android Resolver → Resolve**, or keep auto-resolution on. Grovs works with Unity's custom Gradle templates (`mainTemplate.gradle`, `gradleTemplate.properties`), which EDM4U writes the dependencies into.

## Project Settings

Open **Edit → Project Settings → Grovs**. The values are stored in `Assets/Grovs/GrovsSettings.asset` and are read only at build time, never at runtime. Commit this asset with your project.

| Setting                       | Default                     | Description                                                                                                                                                               |
| ----------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| API key                       | empty                       | Project API key from the Grovs dashboard. An empty key gives a build warning, and the game can't authenticate.                                                            |
| Environment                   | Test for development builds | **Test for development builds** uses the test environment for development builds and production for the rest. Or pick **Production** or **Test** for every build.         |
| Base URL                      | empty                       | Domain of a [self-hosted backend](https://docs.grovs.io/docs/self-hosting/configure/sdk-configuration). Leave empty for the Grovs cloud.                                  |
| Start enabled                 | on                          | Whether Grovs runs before the player has made a consent choice. A choice saved on the device wins. See [Privacy & Consent](https://docs.grovs.io/docs/sdk/unity/privacy). |
| Clipboard domains             | empty                       | Extra link hosts accepted by [clipboard-assisted deferred deep linking](https://docs.grovs.io/docs/sdk/unity/deep-linking#clipboard-assisted-deferred-deep-linking).      |
| URI scheme                    | empty                       | The URI scheme from the dashboard. **Required**: the build fails when it's empty, because iOS authentication fails without it.                                            |
| Link domains                  | empty                       | Your link hosts. List both the production host (`x.sqd.link`) and the test host (`x.test-sqd.link`), plus any custom domain.                                              |
| Push enabled                  | off                         | Turns on Grovs push notifications. See [Push notifications](https://docs.grovs.io/docs/sdk/unity/push-notifications).                                                     |
| Android push mode             | Auto                        | **Auto**, **Firebase Unity** or **Standalone**. See [Push on Android](https://docs.grovs.io/docs/sdk/unity/push-notifications#push-on-android).                           |
| iOS own notification delegate | on                          | Grovs installs a forwarding notification center delegate so it sees push taps.                                                                                            |
| Android small icon            | empty                       | Drawable resource name for the small notification icon.                                                                                                                   |
| Google services JSON path     | empty                       | Android Standalone push only: path to your `google-services.json`.                                                                                                        |
| Track scenes                  | off                         | Reports each active scene change as a screen view. See [Tracking scenes](https://docs.grovs.io/docs/sdk/unity/analytics#tracking-scenes).                                 |
| Log level                     | Error                       | Native SDK log level: Info, Warn or Error. Android has no warn level, so Warn logs at Info there.                                                                         |

Native automatic screen tracking is always off. Screen views come from `TrackScreenView` or **Track scenes**.

### What the build changes

**iOS**, in the exported Xcode project:

- `Info.plist`: the Grovs keys, such as `GrovsApiKey`, `GrovsUseTestEnvironment` and `GrovsEnabled`, and a URL type for the scheme.
- Entitlements: an `applinks:` associated domain for each link domain.
- `UnityFramework` target: the Swift build settings the bridge needs.
- With push on: the `aps-environment` entitlement, the `remote-notification` background mode and `UNITY_USES_REMOTE_NOTIFICATIONS=1`.

No `UnityAppController` changes are needed. Grovs hooks URL opens, universal links and the push token itself.

**Android:**

- Generates `Assets/Plugins/Android/GrovsConfig.androidlib` with the Grovs `meta-data`. It's rebuilt on every build, so you can gitignore it.
- Adds an intent filter for the URI scheme and an `https` intent filter with `autoVerify` for each link domain to your launcher activity, whatever its class name. The filters are replaced on each build.
- Sets `android.useAndroidX=true` and `android.enableJetifier=true` in `gradle.properties`.
- When the Android Gradle plugin is older than 8 (Unity 2022.3 uses 7.4.2), adds a newer R8 (`com.android.tools:r8:8.5.35`) to the root `build.gradle`. See [Troubleshooting](#troubleshooting).

## Dashboard setup

Set up the app in the Grovs dashboard as you would a native app.

**iOS** (SDK Setup → iOS):

- Bundle ID and Apple Team ID. See [How to Get the Apple App Prefix](https://docs.grovs.io/docs/how-to-guides/ios/apple-app-prefix).
- For push campaigns: an APNs `.p8` key.
- For revenue: the App Store IAP API access key.

**Android** (SDK Setup → Android):

- Package name.
- The SHA-256 fingerprint of every key that signs your game: the Unity debug keystore, your upload keystore and the Play App Signing key. See [How to Get the SHA-256 Fingerprint in Unity](https://docs.grovs.io/docs/how-to-guides/unity/sha256-fingerprint).
- For push campaigns: the Firebase service account.
- For revenue: the Play API access key.

The dashboard serves `apple-app-site-association` and `assetlinks.json` from these values. Copy the URI scheme and link domains it shows into Project Settings.

## Receive your first link

```csharp
using GrovsSDK;
using UnityEngine;

public class LinkRouter : MonoBehaviour
{
    void OnEnable() => Grovs.DeeplinkReceived += OnDeeplink;
    void OnDisable() => Grovs.DeeplinkReceived -= OnDeeplink;

    void OnDeeplink(GrovsDeeplink deeplink)
    {
        Debug.Log("Opened from " + deeplink.Link);
    }
}
```

Put it in your first scene. Links that arrive before anyone subscribes are kept and delivered to the first subscriber.

Build to a device, open a link from the dashboard in Notes or Messages, and check the log. To try routing without a device, use [Grovs → Simulate Deep Link](https://docs.grovs.io/docs/sdk/unity/deep-linking#testing-links-in-the-editor).

## Troubleshooting

| Message or symptom                                                  | Fix                                                                                                                                                                                                                                                                                                                                            |
| ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Build fails: `Grovs: URI scheme is empty`                           | Set **URI scheme** to the value from the dashboard.                                                                                                                                                                                                                                                                                            |
| Build warns: `Grovs: API key is empty`                              | Set **API key**. The game builds but can't authenticate.                                                                                                                                                                                                                                                                                       |
| Build fails: `Grovs: Android target API level must be 34 or higher` | Set **Player Settings → Android → Target API Level** to 34 or newer, or Automatic with SDK 34 installed.                                                                                                                                                                                                                                       |
| Android build fails while dexing (D8 or R8) on Unity 2022.3         | Unity 2022.3 uses Android Gradle plugin 7.4.2, whose R8 can't process the libraries Grovs uses. Grovs patches the root `build.gradle`. If your custom base Gradle template sets the plugin version through a variable, Grovs logs a warning instead: add `classpath 'com.android.tools:r8:8.5.35'` to the `buildscript` dependencies yourself. |
| iOS: `No such module 'Grovs'` or link errors                        | Check the [EDM4U settings](#3-check-the-edm4u-settings), open `Unity-iPhone.xcworkspace` (not the `.xcodeproj`), and run `pod install` again if needed.                                                                                                                                                                                        |
| iOS: links don't open the game                                      | Check the link domains, the Associated Domains capability on your App ID, and the Team ID on the dashboard.                                                                                                                                                                                                                                    |
| Android: links open the browser                                     | The SHA-256 of the key that signed this build is missing from the dashboard. Play Store installs need the Play App Signing key.                                                                                                                                                                                                                |
| No deep link reaches my handler                                     | Subscribe to `DeeplinkReceived` early, and check `Grovs.IsEnabled`.                                                                                                                                                                                                                                                                            |
| A `Task` never completes                                            | Pending tasks have no timeout. Call Grovs from the main thread and make sure the player loop is running.                                                                                                                                                                                                                                       |

## Next steps

- [Handle incoming deep links →](https://docs.grovs.io/docs/sdk/unity/deep-linking)
- [Generate smart links →](https://docs.grovs.io/docs/sdk/unity/link-creation)
- [Receive push campaigns →](https://docs.grovs.io/docs/sdk/unity/push-notifications)
- [Show in-app messages →](https://docs.grovs.io/docs/sdk/unity/in-app-messages)
- [Gate collection on player consent →](https://docs.grovs.io/docs/sdk/unity/privacy)

## See also

- [How to Get the SHA-256 Fingerprint in Unity](https://docs.grovs.io/docs/how-to-guides/unity/sha256-fingerprint): the debug, upload and Play App Signing keys
- [How to Get the Apple App Prefix](https://docs.grovs.io/docs/how-to-guides/ios/apple-app-prefix): the Team ID the Grovs dashboard asks for
- [Deep link not opening the app](https://docs.grovs.io/docs/troubleshooting/deep-link-not-opening-app): links open the browser instead of the app
