io.approov.service.unity is a Unity 6+ UPM package that adds Approov protection to both UnityWebRequest and HttpClient.
Add the package from a Git URL in Unity Package Manager:
https://github.com/approov/approov-service-unity.git
After installing the package:
- Import the
Shapes Appsample from the Package Manager if you want the demo content. The sample scene is not shown directly underPackages/io.approov.service.unitybecause Unity hidesSamples~in installed packages. After import, openAssets/Samples/Approov Unity Service Layer/<package-version>/Shapes App/Scenes/SampleScene.unity. - Open
Tools/Approov/Approov Settingsand paste the config string fromapproov sdk -getConfigString. Use the same window to install the native iOS SDK if you are targeting iOS. - For Android, no manual
mainTemplate.gradleor manifest edits are required. The packaged Android library resolves the Approov SDK and OkHttp from Maven automatically. The Android project minimum API level must be set to 23 or higher.
using Approov;
ApproovService.Initialize();The parameterless initializer reads the config string from project settings. Native initialization only runs on iOS and Android player builds.
using Approov;
using UnityEngine.Networking;
UnityWebRequest request = UnityWebRequest.Get("https://approov.io");
yield return ApproovService.SendWebRequest(request);Use ApproovService.SendWebRequest(...) as the primary UnityWebRequest integration surface. It applies request mutation, token injection, secure-string substitution, and Approov certificate validation before dispatch.
ApproovWebRequest remains available for compatibility, but it should not be the primary documented path because Unity method hiding can bypass Approov processing if the instance is handled through a UnityWebRequest reference.
using Approov;
using System.Net.Http;
HttpClient client = ApproovService.CreateHttpClient();
HttpResponseMessage response = await client.GetAsync("https://approov.io");ApproovServiceApproovWebRequestApproovHttpClientHandlerApproovExceptionhierarchy
Low-level native bridge details are package internals and are not the recommended integration surface.
The package includes an editor installer that:
- queries GitHub Releases for
approov/approov-ios-sdk - downloads
Approov.xcframework - installs it into
Assets/Plugins/iOS/Approov.xcframework - pins the resolved release in project settings so the project is reproducible
Use Tools/Approov/Approov Settings to install the latest release, install a specific version, or reinstall the pinned version.
This repository is the package-first home for the shared Approov Unity service layer. It replaces the old quickstart-style repo layout with a reusable package that can be consumed directly from GitHub and used across the main Unity networking surfaces.
The old flow asked users to copy Assets/ into their project and manually fetch native binaries. The package now owns that setup:
- runtime code lives inside the UPM package
- Android dependencies are resolved automatically through Gradle/Maven
- iOS uses the built-in Unity editor installer for
Approov.xcframework - the demo is distributed as a Package Manager sample instead of a separate copy step
- This package is intended only for mobile apps iOS/Android projects
- Unity 6+ or 2022 LTS version
- Android builds require project min SDK 23 or higher
- iOS uses
Approov.xcframework