How build multiple apps from the same codebase in ionic 4

I need to building Branded Apps from a single codebase with different names, icons, splash, theme

1 Like

You can use distributed version control system for the same like Git or any other system.

You can create repository for the app then for each new app you can clone the repository and change the data as per your requirements.

I just thought about something similar. I would create a script (or a own cli if you can :wink:) which sets all app related stuff (app name, id, icon, splash, etc). Then i would load all additional info whatever you want/need by a backend over a primary key which is set in the app.

Let me know if i can help you with something. If someone has a better idea, i would also interessed, bug i would solve it like this :blush:

1 Like

I guess it depends on what falls under the umbrella of “all additional info” here, but for a myriad of reasons I am pretty strongly opposed to designs that operate effectively like Trojan horses, and I use that analogy deliberately to feed the visceral unease I as a user feel towards them.

First, static code analysis is unambiguously awesome. It allows Ivy to improve your app’s performance. It allows ESLint and friends to find bugs before they get out in the wild. It lets security scanners deliver at least a modicum of assurance that the app is not doing malicious things. To that end, there aren’t many things that look more malicious than “periodically phoning home to grab more executable code”.

Self-modifying code has a very long history, and it’s more horror show than uplifting drama. Neither you, your testers, or static code analysis tools are able to actually evaluate during development the actual final app that end-users will be seeing. It becomes impossible to even document what is actually going on in many cases, because what executes is a mixture of horse and Trojan soldiers.

So my vote is to do absolutely everything here at app creation time. If you are concerned about how to modify the core shared parts, turn them into libraries. I would try to avoid any strategy that relies on post-installation patching.

1 Like

In my case i was thinking about create a Order-App for restaurants, which like to have an own app, as this is a perfect usecase for this.

With “load additional” data i mean for example stuff like “name of the restaurant”, “address”, etc. :blush:

1 Like

Let’s just say that there are over 50 results when searching these forums for dynamic component @rapropos.

1 Like

Hey ,
Now I’m able to building Branded Apps from a single code base with different names, icons, splash, theme by creating hooks and custom java-script file which run before executing ionic build command process.

Can any one please tell me how to generate multiple branding apk from single command in ionic 4…

Hello @rachana2020! I was wondering if you had some additional details about how you accomplished this with hooks and a custom js file. I am trying to create a single App that can take in custom logo/branding colors and this sounds exactly what I need.