Unity SDK
The Loxily Unity SDK is a cross-platform (iOS / Android) Unity integration package. Once imported, you call one unified
LoxilyLocalize.*C# API for runtime string lookup, language switching, AI screenshot review, and player co-creation — no need to wire up the two native SDKs separately.Integration requires a Loxily platform account (appKey). The SDK is the client only; translations and publishing are managed on the platform side.
Which integration path?
- Unity project → use the Unity SDK package on this page (recommended — one C# API covers both platforms).
- Native iOS / Cocos2dx and other non-Unity projects → use the iOS SDK / Android SDK.
Requirements
- Unity 2020.3+ (IL2CPP required for iOS)
- iOS 12+ / Android minSdk 22+
- EDM4U (External Dependency Manager for Unity) recommended for Android dependency resolution
- A Loxily platform account and appKey
Integration Steps
1. Import from the Unity Asset Store
Integrating via the Unity Asset Store is recommended — the Package Manager tracks the version for you, so future upgrades are one click, with no manual repackaging.
① Open the product page and add it to My Assets
Open the Loxily Localization SDK product page in your browser (sign in with your Unity account):
Click Add to My Assets on the right → accept the EULA, and the button turns into Open in Unity. This adds the asset to your account's My Assets, so you can pull it from inside the editor.

Product page under review
After submission the Loxily SDK sits in Unity's review queue (Pending). The link above only works once the review passes and the asset goes live; before that it returns 404. The link on this page starts working automatically once approved.
② Download and import inside Unity
Back in the Unity editor, open Window → Package Manager → set the Packages dropdown (top left) to My Assets → find Loxily Localization SDK in the list → click Download (bottom right), then Import once it finishes.

③ Import everything
In the Import Unity Package dialog, keep everything selected and click Import.

The package contains: the C# bridge layer (Runtime/), the iOS bridge and xcframework (Plugins/iOS/), Android dependency declaration and iOS build script (Editor/), and a sample (Demo/).
Can't reach the Asset Store? You can also download the offline
.unitypackage— see Offline package (fallback) at the end.
2. Android: resolve dependencies
The Android SDK itself (the com.loxily:android-localize-sdk aar) is fetched from Maven via EDM4U:
Menu Assets → External Dependency Manager → Android Resolver → Resolve.
Without EDM4U you can add
implementation 'com.loxily:android-localize-sdk:1.7.7'tomainTemplate.gradleand ensuremavenCentral()is in your repositories.
3. iOS: no manual -ObjC needed
The bundled post-process build script automatically adds -ObjC to the Xcode UnityFramework target.
Why -ObjC is required
The iOS SDK is a static library and uses Objective-C categories (e.g. gg_isEmpty on NSString). When linking a static library, categories produce no new linker symbols and get dropped, causing a runtime crash unrecognized selector sent to instance. -ObjC forces all ObjC classes and categories to load. The SDK static library links into the UnityFramework target, so -ObjC must be on that target (handled automatically; if adding manually, add it to the framework target, not the app target).
4. Use it in C#
using UnityEngine;
public class MyLocalization : MonoBehaviour
{
void Start()
{
// 1) Prepared callback (fires on the main thread once the language pack is ready)
LoxilyLocalize.SetOnTranslationPreparedCallback(success => {
if (success)
Debug.Log(LoxilyLocalize.GetString("100000001", "default"));
});
// 2) Initialize (isInternationalizing=true uses the international site)
LoxilyLocalize.Init("YOUR_APP_KEY", "en", true);
}
}About the version number (important)
The SDK uses appVersion to fetch translations and reads the app version automatically — you do not set it manually or update the SDK per release:
| Platform | Source |
|---|---|
| iOS | CFBundleShortVersionString (= Player Settings → Version) |
| Android | packageInfo.versionName (Unity direct build = Player Settings → Version; native integration = gradle versionName) |
Your game's real version must fall within a published translation version range on the platform; otherwise no translations are returned (the backend matches by range).
Main API
// Init / prepared callback
LoxilyLocalize.Init(string appKey, string language, bool isInternationalizing, bool isBuildDebug = false);
LoxilyLocalize.SetOnTranslationPreparedCallback(success => { ... });
// String lookup
string LoxilyLocalize.GetString(string code, string defaultStr = null);
string LoxilyLocalize.GetPageString(string pageId, string code, string defaultStr = null);
// Switch language (wait for OnPrepared again before reading strings)
LoxilyLocalize.UpdateLanguage(string language);
// User info (userId required for co-creation)
LoxilyLocalize.UpdateUserInfo(new LoxilyLocalizeUserConfig.Builder()
.SetUserId("uid").SetUserTags("vip1").Build());
// AI screenshot review
LoxilyLocalize.ReviewCurrentScreen(string[] stringIds, byte[] imageBytes);
// Player co-creation suggestion (built-in UI)
LoxilyLocalize.SuggestTranslation(string[] stringIds, byte[] imageBytes);
// Co-creation: headless programmatic submit
LoxilyLocalize.SubmitTranslationSuggestions(
new[] { new LoxilyTranslationSuggestion("100000001", 5, "my suggestion") },
(success, ratingCount, suggestionCount, err) => { ... });
// AI Agent floating bubble
LoxilyLocalize.ShowAgentBubble();
LoxilyLocalize.HideAgentBubble();
LoxilyLocalize.SetLogEnable(bool enable); // log toggleBuild & debugging notes
- iOS Simulator: Player Settings → iOS → Target SDK = Simulator SDK; iOS Device: Device SDK. The two Xcode projects are incompatible — re-Build after switching.
- A
errSecInternalComponenton-device signing failure is usually a keychain / duplicate-cert issue; aCommand CodeSign failedfollowed byunrecognized selectoron a framework means-ObjCis missing on the framework target (see above). - Some Unity / Tuanjie engine versions are unstable during engine startup (frameworkWarmup) on the iOS Simulator — prefer testing on a real device.
Offline package (fallback)
Prefer the Unity Asset Store — the version is managed by the Package Manager and upgrades are one click. Only use the offline package when you can't reach the Asset Store (network restrictions, account issues, etc.): download it, then double-click it or import via Assets → Import Package → Custom Package.
The offline package has the same content as the Asset Store version, but upgrading means manually re-downloading and re-importing — unlike the Asset Store, where you update in one click from the Package Manager.
Manual / advanced integration (optional)
Most projects should just use the package above. But if you have a custom build pipeline (not using UPM / .unitypackage), an existing native-heavy project, or need to drop the SDK into a pre-built native shell, you can wire the bridge yourself — the mechanism is identical to what the package does, just reproduced by hand:
iOS
- Add
loxilyLocalizeSDK.xcframeworkas a Unity iOS plugin (or add it manually in the exported Xcode project). - Add the ObjC bridge
LoxilyLocalizeUnity.mm(it exportsextern "C"entry points for C#[DllImport("__Internal")]). - Manually add
-ObjCto the target that links the SDK static library (UnityFramework) — omit it and you get a runtimeunrecognized selectorcrash. - On the C# side, declare
[DllImport("__Internal")]externs whose signatures match theextern "C"functions in the.mm.
Android
- Add
implementation 'com.loxily:android-localize-sdk:1.7.7'tomainTemplate.gradlemanually, and ensuremavenCentral()is insettingsTemplate.gradle. - On the C# side, call the Java SDK via
AndroidJavaClass/AndroidJavaObject.
Reference implementation: the package's
Runtime/LoxilyLocalizeiOSCore.cs,Runtime/LoxilyLocalizeAndroidCore.cs, andPlugins/iOS/LoxilyLocalizeUnity.mmare the canonical bridge — mirror them when integrating manually. Note that upgrading means manually replacing these files, unlike swapping a single.unitypackage— prefer the package unless you have a hard constraint.
FAQ
Q: Do I update the SDK package on every game release? No. Integrate once and leave it; the version flows through your game's normal release process, and the SDK reads the real APK version automatically.
Q: Is bridging required? Can it be pure C#? Unity is C# and the SDK is native (Java/ObjC), so a C#↔native bridge is unavoidable — this is the standard approach. The package already wraps it for you, so you just write pure C# against LoxilyLocalize.* and never touch the low-level layer.