AR SDK Overview
The AR SDK provides a Unity-based augmented reality experience that you drive from your own UI through a bi-directional bridge.
You can integrate it in one of two ways, both of which speak the exact same command/event protocol:
- Web — load your UI in a WebView; commands and events cross a JavaScript bridge. See the Web Integration page.
- Native (Swift / Kotlin) — embed the SDK in a native iOS/Android app using Unity as a Library, and drive it from SwiftUI/UIKit or Jetpack Compose/Views. See the iOS (Swift) and Android (Kotlin) pages.
The command vocabulary ({ type, data } in, named events out) is identical across both — only the transport differs.
How the bridge works
The AR SDK uses a communication bridge between your UI and the Unity-based AR engine:
- Outbound (UI → SDK): Send
{ type: string, data: object }commands. In Web, useUnity.call(JSON.stringify(...)). In Native, use the typedTreedisARSDKfacade (which forwards to Unity under the hood). - Inbound (SDK → UI): Receive named events. In Web, via the global
onUnityMessage(message)function (and a few direct JS calls). In Native, via theTreedisARSDKDelegate(iOS) /TreedisARSDKListener(Android) callbacks.
Choosing an integration
| Web | Native (Swift / Kotlin) | |
|---|---|---|
| UI technology | HTML/JS in a WebView | SwiftUI/UIKit, Jetpack Compose/Views |
| How it ships | Your web app + the SDK app | Unity engine embedded in your native app (UaaL) |
| You call | Unity.call(...) |
TreedisARSDK facade |
| You receive | onUnityMessage(...) |
delegate / listener callbacks |
Whichever you choose, the initialization sequence is the same: set the window size, set the environment, set the tour info, then start localization.
Supported AR object types
The following type strings are valid for showARObject, hideARObject, and onARObjectClick across all integrations:
TAGVS_IMAGEVS_VIDEOVS_OBJECTVS_HTMLPOLYGONTHREAD

