How to Setup Remote Config

Use this guide to configure Unity Remote Config — used to let live ops values (which ad provider is active, interstitial pacing, a minimum supported app version) be changed without a build. Based on the project's RemoteConfigManager.cs and package com.unity.remote-config 4.2.5.

Architecture Context

  • RemoteConfigManager.Initialize() calls UnityServices.InitializeAsync() and signs in anonymously (Unity.Services.Authentication) before fetching — this requires the Unity project to be linked to a Unity Cloud project, the same linkage the IAP and Ads systems rely on.
  • Unlike the ad providers, there's no App ID / API key to paste into a settings asset here — the whole integration is: (a) the project is linked to a Unity Cloud project ID via Project Settings → Services, and (b) the exact remote config key names this project reads exist (or don't — falling back to local defaults) in that Unity Cloud project's Remote Config dashboard.
  • The exact keys this project reads, all defined as const string in RemoteConfigManager.cs:
    • AdsProvider (string) — one of NoAds / Fake / AdMob / UnityAds / Yodo1; falls back to GameConfig.AdsProviderMobile if unset remotely.
    • AppVersionAndroid / AppVersioniOS (string) — whichever one matches the current platform is read into FetchedAppVersion.
    • ShowInterstitial (bool) — falls back to GameConfig.ShowInterstitial.
    • InterstitialStartLevel (int) — falls back to GameConfig.InterstitialStartLevel.
    • InterstitialLevelInterval (int) — falls back to GameConfig.InterstitialLevelInterval, clamped to a minimum of 1.
  • If the device has no internet connection, or initialization/sign-in times out (1s / 1.5s timeouts respectively), RemoteConfigManager skips the fetch entirely and processes with whatever GameConfig defaults are already set locally — remote config is a soft override, never a hard requirement to run the game.

Pre-Setup Checklist

  • A Unity Gaming Services project created (or reused from the same one IAP/Ads Remote Config-driven provider selection already uses).
  • The Unity project linked to it via Project Settings → Services (or the Unity Hub organization/project linking flow).
  • com.unity.remote-config (4.2.5) installed via the Package Manager.

Main Procedure

Edit → Project Settings → Services, sign in, and link (or create) the Unity Cloud project this build should pull config from.

Step 2: Create the Remote Config Values

In the Unity Cloud Dashboard's Remote Config panel for that project, create entries matching the exact key names and types listed in Architecture Context above (AdsProvider as a string, ShowInterstitial as a bool, and so on) — the names are case-sensitive and must match the constants in RemoteConfigManager.cs exactly, or that key is simply never fetched and the local default is used instead.

Step 3: Set Local Fallback Defaults

Regardless of what's configured remotely, set sane values on GameConfig itself (AdsProviderMobile, ShowInterstitial, InterstitialStartLevel, InterstitialLevelInterval) — these are what the game uses whenever remote config can't be reached at all.

Step 4: Validate

Run the game with a value changed in the dashboard (e.g. flip ShowInterstitial), and confirm the Log.Info line in RemoteConfigManager.OnRemoteConfigFetched shows the new fetched values on the next run.

Common Edit Recipes

Recipe A: Add a New Remote-Controllable Value

Add a new const string ...Key in RemoteConfigManager.cs, a matching private field + public getter, read it in OnRemoteConfigFetched with the appropriate RemoteConfigService.Instance.appConfig.Get*() call and a local GameConfig fallback, then create the matching key in the dashboard.

Recipe B: Force Local-Only Behavior for a Build (No Remote Fetch)

Test with no network connection, or a very short-lived one — the existing timeout/NetworkReachability guard already falls back to local GameConfig values, no code change needed to simulate an offline user.

Troubleshooting

  • Fetched values never change. Confirm the Unity project is actually linked to the same Unity Cloud project you're editing values in — a stale or wrong link silently keeps using local defaults.
  • Key names match, but the value is still the default. Remote Config key names and types are case-sensitive and type-sensitive — a bool key saved as a string in the dashboard (or vice versa) won't parse.
  • Sign-in or fetch consistently times out. Check _timeoutInitialize / _timeoutSignIn (1s / 1.5s) aren't just too tight for the network conditions you're testing under — this is a deliberately short timeout so a slow network degrades to local defaults instead of blocking startup.