Browse docsOverview
Unity SDK

Installation

Three ways to add Reflect to your Unity project. UPM Git URL is the recommended path — instant updates, no review delay.

Requirements

  • Unity 2021.3 LTS or newer
  • Android: minSdkVersion 21 (Android 5.0)
  • iOS: iOS 13+
  • EDM4U (External Dependency Manager for Unity) — required for iOS: it resolves the shared ReflectCore engine (the SDK auto-repairs the generated Podfile, so there are no manual CocoaPods steps). Android works with or without EDM4U — a bundled Gradle post-processor injects the same dependency automatically.

Option A — UPM Git URL (recommended)

In Unity, open Window → Package Manager, click +, choose Add package from git URL…, paste:

https://github.com/bablu147/reflect-sdk.git#v2.4.4

Pin to a tag (the #v2.4.4 suffix). Bumping versions is one line in Packages/manifest.json:

{
  "dependencies": {
    "com.reflect.sdk": "https://github.com/bablu147/reflect-sdk.git#v2.4.4"
  }
}

Option B — Unity Asset Store

Search the Asset Store for Reflect — Free MMP for Unity, click Add to my assets, then import via the Package Manager’s My Assets tab. Free.

Use the Asset Store for discovery, the Git URL for updates.
Asset Store updates go through Unity QA review (5–20 days). The Git URL ships within minutes of a tag push. Both work; mix as you like.

Option C — manual .unitypackage

Download the latest Reflect-2.4.3.unitypackage from the GitHub releases page, drag into Unity, click Import. Useful for offline / air-gapped environments (note: iOS still needs EDM4U to resolve the ReflectCore pod).

Android — auto-handled Gradle setup

Reflect’s Android engine (the shared reflect-android core, from JitPack) and its two Google Play libraries are injected into the Gradle build automatically — via EDM4U if installed, otherwise by the SDK’s bundled Gradle post-processor. For reference, the dependencies involved:

dependencies {
    implementation 'com.github.bablu147:reflect-android:1.1.2'  // shared core (JitPack)
    implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
    implementation 'com.android.installreferrer:installreferrer:2.2'
}

You only add these by hand if you opted out of the automation with REFLECT_SKIP_ANDROID_GRADLE.

Core 1.1.0 is a floor, not a preference.
1.1.0 is the first published Android core that contains the privacy engine at all —1.0.0 shipped without one. If you pin the core yourself, never pin below1.1.0.

Release builds (R8 / minification) — now handled automatically. A minified release build would otherwise strip the SDK’s native bridge (com.reflect.sdk.**, used for device-info and install-referrer collection), making app_install never fire — installs/attribution would disappear even though a debug APK works. As of v2.2 a Unity Editor post-processor auto-injects the ProGuard keep-rules (and the Google deps) into the generated Gradle on every build, so this can no longer be misconfigured — no manual Custom Proguard File step required. (To manage Gradle yourself, define REFLECT_SKIP_ANDROID_GRADLE and follow Plugins/Android/REFLECT_GRADLE_SETUP.md.) Sanity-check a minified build with adb logcat | grep -i reflect: you should see Device info collected. and an app_install event.

The AD_ID permission for the Google Advertising ID is declared by the SDK manifest and merges in automatically (remove it only for COPPA/kids apps). In Google Play Console you must still declare it: App content → Advertising ID and Data safety (Device or other IDs).

iOS — auto-handled

The SDK’s build post-processor wires everything for you on each iOS build:

  • Resolves the shared ReflectCore engine via EDM4U + CocoaPods, and auto-repairs the generated Podfile (git pod source, linked into the right target) — build the generated Unity-iPhone.xcworkspace, not the .xcodeproj
  • Adds AdSupport, AppTrackingTransparency, AdServices frameworks + the Swift build settings the bridge needs
  • Injects NSUserTrackingUsageDescription into Info.plist (customize via ReflectBuildPostProcessor.AttUsageDescription)
  • Copies PrivacyInfo.xcprivacy (SDK-level privacy manifest)
ReflectCore is not on CocoaPods trunk.
It is consumed from its GitHub tag, so the pod line always needs an explicit git source. That is exactly what the post-processor writes into the generated Podfile for you:
pod 'ReflectCore', :git => 'https://github.com/bablu147/reflect-ios.git', :tag => '1.1.4'
If you wire the Podfile yourself, copy that line verbatim — a bare pod 'ReflectCore'cannot resolve. Tag 1.1.1 is the floor: it is the first core release that does not brand every event flutter on the wire; 1.1.2 adds the batch-size/byte clamps; 1.1.3 fixes jailbreak detection false-positiving on all real iPhones; 1.1.4 fixes first-session delivery (install latched at durable persistence, retry ladder, activation + background flush).

Set the scripting define REFLECT_SKIP_IOS_POSTPROCESS if you’d rather wire these manually.

Verify

After import, open Edit → Project Settings → Player. The Reflect SDK doesn’t change any settings on its own — it just adds files. Open the Project window and confirm you see Packages/Reflect SDK/ with Editor/, Plugins/, Runtime/, Samples~/ folders.

Try the Basic Usage sample (Package Manager → Reflect SDK → Samples → Import). It runs the SDK in debug mode (no BaseUrl) so you can see the in-game overlay before connecting to a server.