Dark Mode - StansAssets/com.stansassets.ultimate-mobile GitHub Wiki

It's a very good touch to respond to the user UI theme system preference and update your app appearance accordingly. Both iOS and Android platforms provide this preference to a user, and Ultimate Mobile allows you to check it and update UI appearance accordingly.

To know if the system is currently in dark theme or not, you can implement the following code:

using SA.CrossPlatform.App;
...

Debug.Log(UM_Application.IsDarkMode 
            ? "Night mode is active, we're using dark theme" 
            : "Night mode is not active, we're using the light theme");

Be notified of a change in the theme

So far it's not possible to implement a callback to be notified whenever the theme changes, but that's not a problem. Users can not change the theme while your Unity application is running. So you can choose 2 strategies for how you wish to support the dark theme.

  • You can check it all the time when the app is resumed, see the OnApplicationPause
  • If you do not care much about app theme immediate response (and tbh it will be not super easy to implement immediate skin change) you can only do this check during app launch.