React Native Branding Basics

Overview

Due to nature of the platform, branding is provided differently for iOS and Android.

  • On Android branding customization is done via the style resource files, much like for the native apps.
  • On iOS branding customization is done via the runtime properties.

Android

Due to properties of the Android theming system, no special runtime / code based theme customization can be done at this time. However, the native method of the Sensibill Android SDK customization method can still be achieved.

Info

Android theme customization will be easier if Android Studio is used.

Customization involves creating and editing some Android xml resoruce files.

Extra details and assumptions will be outlined here as a refresher on Android project structure.

Assumptions

Within this Android section, we assume your project has a standard structure, specifically:

  • /android is a folder containing the android-specific code for the project
  • The /android/app folder exists, and is the root for the Android app module’s code

If you have not made any significant Android subproject changes from the project structure generated by react-native init, the above assumptions should hold true. If they do not, please keep these assumptions in mind when following further instructions.

Terminology & References

  • Filepaths with a leading / will refer to a path relative to the project root
  • The Android “resources folder” is located at /android/app/src/main/res
  • Most, if not all theming customization will be done within this resources folder
  • The resources folder contains subfolders for resource categories. Each subfolder contains xml files defining various Android resources
  • Terminology-wise, we will refer to these resource folders by their category, then “resources folder”. Therefore, the “values resources folder” would mean the " /android/app/src/main/res/ values/ " folder.

iOS

iOS Branding customization is done using the SbBranding interface, available as an optional branding property of the SbCaptureConfiguration . Some customizations also require adding resources to an iOS app. The details are explained in corresponding sections.

The following aspects of the branding can be configured:

The created SbCaptureConfiguration configuration must passed to SensibillCaptureStandalone.captureDocuments(), as explained in the Capture Configuration section.