Customize Fonts for In-App Messages on Android

By default, in-app messages use the system font of the user’s device. Override the default font face to customize the appearance of the title, body, and button labels for your in-app message. The design of the message determines the font size, so you can’t change it.

To set the display font, pass the SDK a valid TypeFace for the device’s installed fonts, or your app’s custom fonts.

Use this code to customize fonts in version 11 of the SDK for Android.

1// set at configuration time
2SFMCSdk.configure(applicationContext as Application, SFMCSdkModuleConfig.build {
3  inAppMessagingFeatureModuleConfig = InAppMessagingFeatureConfig.builder().apply {
4    setTypeface(appFontFace)
5  }.build()
6})
7
8// OR set after configuration time
9InAppMessagingFeature.requestSdk { inAppMessagingFeatureModule ->
10  inAppMessagingFeatureModule.getInAppMessageManager().setTypeface(appFontFace)
11}

Use this code to customize fonts in version 10 of the SDK for Android.

1MarketingCloudSdk.requestSdk { engagementSdk ->
2  engagementSdk.inAppMessageManager.setTypeface(appFontFace)
3}

Use this code to customize fonts in version 8 of the SDK for Android.

1SFMCSdk.requestSdk { sdk ->
2  sdk.mp {
3    it.inAppMessageManager.setTypeface(appFontFace)
4  }
5}

Use this code to customize fonts in version 7 of the SDK for Android.

1MarketingCloudSdk.requestSdk { sdk->
2  sdk.inAppMessageManager.setTypeface(appFontFace)
3}