# Unity SDK

> Add deep linking, attribution, push campaigns, in-app messages and revenue tracking to Unity games on iOS and Android.

Source: https://docs.grovs.io/docs/sdk/unity

Deep links, link generation, push campaigns, in-app messages, event and screen tracking, revenue and attribution for Unity games on iOS and Android. Package 1.0.0 is a C# layer over the native SDKs (`Grovs ~> 3.1` on iOS, `io.grovs:Grovs:[3.1.0,3.2)` on Android).

**Requirements:** Unity 2022.3+ (Unity 6 included), iOS 13.0+, Android target API 34+, [External Dependency Manager for Unity](https://github.com/googlesamples/unity-jar-resolver). Install `com.grovs.sdk` with the Package Manager.

- [Quick Start](https://docs.grovs.io/docs/sdk/unity/quick-start): Install the package and fill in Project Settings
- [Deep Linking](https://docs.grovs.io/docs/sdk/unity/deep-linking): Handle incoming deep links and SDK errors
- [Link Creation](https://docs.grovs.io/docs/sdk/unity/link-creation): Generate smart links from the game
- [Push notifications](https://docs.grovs.io/docs/sdk/unity/push-notifications): Push campaign opens and links on iOS and Android
- [In-app messages](https://docs.grovs.io/docs/sdk/unity/in-app-messages): Dashboard campaigns shown over the game
- [Revenue](https://docs.grovs.io/docs/sdk/unity/revenue): Store purchases, Unity IAP and custom payments
- [Events & Screen Tracking](https://docs.grovs.io/docs/sdk/unity/analytics): Track custom events, screens and scenes
- [Privacy & Consent](https://docs.grovs.io/docs/sdk/unity/privacy): Gate collection on consent
- [API Reference](https://docs.grovs.io/docs/sdk/unity/api-reference): All properties, events and methods

## How it works

There's no init call. The values in **Edit → Project Settings → Grovs** are written into the iOS and Android builds, and the native SDK starts before Unity does, so a link that opens the game is never missed. C# events, callbacks and awaited results run on the Unity main thread.

In the Editor and on other platforms every call goes to a stub: it logs once, drops events, fails link generation with `UnsupportedPlatform` and resolves purchases to `false`. Use [Grovs → Simulate Deep Link](https://docs.grovs.io/docs/sdk/unity/deep-linking#testing-links-in-the-editor) to test link routing in Play Mode.

## Demo sample

In the Package Manager, select **Grovs**, open **Samples** and import **Demo**. The `GrovsDemo` scene has one button per feature: generate and copy a link, show the last deep link, track an event and a screen, set the user ID and attributes, toggle consent, pause, resume and discard in-app messages, and log a custom purchase. It draws its UI with IMGUI, so it needs no UI package. Set your keys in Project Settings and build to a device.
