Custom Fonts
Using custom fonts in the React Native SDK
The OpenWeb iOS SDK lets you use custom fonts to match your app’s look and feel. In the React Native SDK, custom fonts are also supported, but they need to be set up using native platform APIs. This means font customization is handled in native code, rather than through JavaScript props.
Important Notes
- Font changes apply globally to all OpenWeb conversation views.
- Fonts must be properly bundled in your native projects (see platform guides).
- Apply fonts before creating conversation views for immediate effect.
iOS Implementation
You can set custom fonts anywhere in your iOS code before OpenWeb conversation views are displayed.
For example:
import OpenWebSDK // ← Add this import
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
let customizations: OWCustomizations = OpenWeb.manager.ui.customizations
// Set custom font once at app startup
customizations.fontFamily = .custom(fontFamily: "Roboto")
// Your existing React Native setup...
return true
}
}
See native iOS SDK font documentation
Android Implementation
You can set custom fonts anywhere in your Android code before OpenWeb conversation views are displayed.
For example:
import android.app.Application
import com.openwebsdk.OpenWeb // ← Add this import
class MainApplication : Application() {
override fun onCreate() {
super.onCreate()
val customizations = OpenWeb.manager.ui.customizations
// Set a custom font family
customizations.fontFamily.styleResId = R.font.my_custom_font
// Your existing React Native initialization code...
}
}See native android font documentation
Updated about 4 hours ago
