# Customization

The React Native SDK supports customization of text, localization, icons, videos, and visual themes. The available options and the methods used to apply them differ between Android and iOS for legacy (v1) screens - see the platform-specific sections below. The redesigned v2 screens (for example ID Scan V2) use a unified theme system that works the same way on both platforms via `setTheme()`; see the shared note at the bottom of this page.

## Android

The following covers v1 customization options for legacy screens. For v2 customization, see the intro above.

### Customization options

- **Text and localization**: Override SDK strings and add languages.
- **Icons and videos**: Replace SDK assets with your own.
- **Theme (ID Scan V2 only)**: `setTheme()` on Android currently supports customization exclusively for the ID Scan V2 feature. For legacy (v1) theme customization (colors, fonts, buttons, and other components), use the full guide below instead.

For configuration details, see the full Android customization guide [here](https://developer.incode.com/docs/user-guide-customization).

### Method examples

To set the runtime localization language, call `setLocalizationLanguage()`. Supported values are currently `en`, `es`, and `pt`:

```ts
await IncodeSdk.setLocalizationLanguage('en');
```

To override an individual string, call `setString()`:

```ts
IncodeSdk.setString({
  onboard_sdk_btn_passport: 'Passport',
});
```

To localize plural strings, call `setQuantityStrings()`:

```ts
await IncodeSdk.setQuantityStrings({
  en: {
    onboard_sdk_validation_attempts_remaining: {
      one: '%d attempt remaining',
      other: '%d attempts remaining',
    },
  },
  es: {
    onboard_sdk_validation_attempts_remaining: {
      one: '%d intento restante',
      other: '%d intentos restantes',
    },
  },
});
```

### Dependency requirements

The `setLocalizationLanguage`, `setString`, and `setQuantityStrings` methods require the Android extensions dependency:

```gradle
implementation 'com.incode.sdk:extensions:1.2.1'
```

## iOS

The following covers v1 customization options for legacy screens. For v2 customization, see the intro above.

### Customization options

- **Icons and videos**: Replace SDK assets with your own. See the guide [here](https://developer.incode.com/docs/user_guide_customization).
- **Text and localization**: Override SDK strings and add languages. See the guide [here](https://developer.incode.com/docs/localization-guide).
- **Theme**: Customize colors, fonts, buttons, and components.

### Method examples

`setLocalizationLanguage()` and `setString()` are also available on iOS, with the same behavior as Android.

`setQuantityStrings()` exists on iOS for API compatibility, but it is currently a no-op there - the call resolves successfully without applying anything. Plural strings can only be localized this way on Android.

To change the theme, call `setTheme` with a stringified theme JSON:

```ts
const jsonTheme = JSON.stringify({
  colors: {
    accent: '#00B2FD',
    primary: '#20263D',
    background: '#FFFFFF',
  },
  // See the iOS customization guide for the full theme schema.
});

IncodeSdk.setTheme({ jsonTheme });
```

### Dependency requirements

Unlike on Android, no additional native dependency is required for `setLocalizationLanguage`, `setString`, or `setQuantityStrings` on iOS.

## ID v2 Customization

Both platforms support the customization of ID v2 experience via `IncodeOnboardingSdk.setTheme(theme: theme)`:

- [Android configuration guide](https://developer.incode.com/docs/user-guide-customization#7-id-v2-customization-guide)
- [iOS configuration guide](https://developer.incode.com/docs/user_guide_customization_v2)

<br />
