Quite frecuently we have to face projects where we have to develope a single app that must be built for different clients. Normally every client requires it’s own theme (styles, logos, etc…). Moreover, this kind of projects are usually multi-platform, so we have to build the apps for Android, iOS and a web server. And in most cases, the app contains platform specific code. Besides that, when we build the app for Google and iOS markets, we need to deal with different app ids and names making the management of the config.xml a pain.
This multi-brand & multi-platform requirement makes these projects’ code quite difficult to handle with. Furthermore, the build scripts needed to manage all this brand&platform specific code get very complex.
Ionic docs give some advice about how to customize the default themes to a specific brand, but I haven’t found any recommended solution for these multi-brand situations.
Ionic API also allows us to check the platform in runtime and take decissions based on which platform you are running. But one of the biggest problems I find is that some projects require that each specific build (brand&platform) must not contain any code nor asset from any other brand & platform.
In Android native development, we have flavors and build types that allow us to manage all the specific code in an easy way. With a very little effort, each package we build has it’s own branding and doesn’t contain any code that belongs to other brands&platforms.
Given the multi-platform nature of Ionic, i think that there should be an official & recommended approach for this kind of projects: project structures, Webpack build configurations, cordova config.xml management, etc.