Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make multiple app variants with shared codebase in react native?

Tags:

react-native

I'm trying to understand the possibility of creating a while label product with the help of react native.

The problem to solve is that by using the same codebase and some configurational changes, we get four different applications each with its own branding assets (in both ios and android).

Is it possible to do that in react native? xcode targets and android flavours are there. How can we architect this under react native way so we don't have to deal with native code/ configuration.

like image 296
Waqar Avatar asked Jun 26 '18 12:06

Waqar


1 Answers

So the way I ended up doing is by using 12 Factor methodology.

The configuration is loaded through the .env file loaded while building the app and then based on that env file all resources are collected on the go.

The configuration took some time but it was well worth at the end. 6 apps (3 iOS and 3 android apps) out of one codebase.

This is the article that explains how to do it.

Adding multiple target pipelines for React Native Apps (and Fastlane CircleCI deployment

like image 101
Waqar Avatar answered Nov 15 '22 10:11

Waqar