Skip to main content

Dark Mode Settings

  • Use setHostMeta() to pass dark mode settings to the ad creatives.

    Deliver the settings for all ad slots when using gladsdk.setHostMeta().

    Deliver the settings for the specific ad slot when using adSlot.setHostMeta().

  • The below three values can be passed to setHostMeta() with "theme" as the key

    themeDescription
    systemSet to use the device OS dark mode settings
    darkEnable dark mode when managing the dark mode settings of the service
    lightDisable dark mode (light mode) when managing the dark mode settings of the service
    window.gladsdk.setHostMeta('theme', 'system');

    window.gladsdk.setHostMeta('theme', 'dark');

    window.gladsdk.setHostMeta('theme', 'light');
info

The Dark Mode is not supported on all ad creatives.

The theme change only applies the ad creative that is support Dark Mode.