Aller au contenu principal

Android Configuration

Configure the Azeoo SDK when you call AzeooSDK.init(...). User ID and token are not part of config; they are passed later in connect(userId, token).

Config (AzeooConfig)

Passed at init:

val config = AzeooConfig(
locale = "en",
analyticsEnabled = true,
offlineEnabled = true,
)

AzeooSDK.init(
context = this,
apiKey = "your-api-key",
config = config,
theme = themeConfig, // optional
deepLinks = deepLinkConfig, // optional
safeArea = safeAreaConfig, // optional
)

Theme (AzeooThemeConfig)

Optional theme at init:

val themeConfig = AzeooThemeConfig(
lightPrimaryColor = 0xFF0284C7.toInt(),
lightSecondaryColor = 0xFF7dd3fc.toInt(),
darkPrimaryColor = 0xFF38bdf8.toInt(),
darkSecondaryColor = 0xFF0ea5e9.toInt(),
successColor = 0xFF10b981.toInt(),
errorColor = 0xFFef4444.toInt(),
warningColor = 0xFFf59e0b.toInt(),
)

Safe area (AzeooSafeAreaConfig)

Optional safe area at init:

val safeAreaConfig = AzeooSafeAreaConfig(
top = true,
bottom = true,
left = true,
right = true,
)

Optional deep link config at init:

val deepLinkConfig = AzeooDeepLinkConfig(
scheme = "yourapp",
host = "yourapp.com",
pathPrefix = "/sdk",
)

Runtime theme changes

After connect, use the theme API:

AzeooSDK.shared.theme.setDarkMode()
AzeooSDK.shared.theme.setPrimaryColor(Color.parseColor("#0284C7"))
AzeooSDK.shared.theme.setLightMode()
AzeooSDK.shared.theme.getCurrentTheme()

Next steps