Hi @Ron Dul ! Ebenezer here from Engineering Support👋.
- The SDK uses a ThemeManager to determine the current theme mode (light, dark, or system/default).
- The IntercomTheme composable applies the correct color palette based on the theme mode.
- Utility functions are provided to select the appropriate color for the current theme, both in Compose and non-Compose contexts.
- You can override the theme mode at runtime (e.g., to allow users to toggle between light and dark modes within your app).
You can set the theme mode using the ThemeManager. For example, to force dark mode:
import io.intercom.android.sdk.ui.theme.ThemeManager
import io.intercom.android.sdk.ui.theme.ThemeMode
// To force dark mode
ThemeManager.setSessionOverride(ThemeMode.DARK)
// To force light mode
ThemeManager.setSessionOverride(ThemeMode.LIGHT)
// To follow the system theme
ThemeManager.setSessionOverride(ThemeMode.SYSTEM)
If you are using Jetpack Compose, wrap your Intercom Messenger UI in the IntercomTheme composable. The theme will automatically adapt based on the current theme mode:
import io.intercom.android.sdk.ui.theme.IntercomTheme
IntercomTheme {
// Place your Intercom Messenger UI here
}
If you need to select colors manually (e.g., for custom UI elements), use the provided utility:
import io.intercom.android.sdk.utilities.ThemeUtils
val color = ThemeUtils.selectColorForTheme(context, "#FFFFFF", "#14161a")