Loading code dynamically on the fly in Ionic


I have been developing Ionic Apps for some time and it came a new requirement by the client, to have components loaded dynamically on the fly. Like for example a game and it’s DLC’s (Downloadable content).

So the main idea would be to have a core application that could be pushed to the APP store, this app would have a login area, and upon the login that user would have access to certain modules configuration/permissions, eg. 1,4,5, so the app would know and download those modules and activate just those(they would not be in the core application(. would this be possible on Ionic? if yes how to or some tips

Best regards

There is at least no out of the box functionality for this.

Ok not out of the box, but can you see some constraints on why it cant be implemented? or i should look in a different way rather than ionic?

Depending how many modules you have, you could look at using ionic deploy https://ionicframework.com/docs/pro/deploy/setup/#usage

If you used a separate channel for each module/configuration, you could then swap channels and download the required code for each channel. There’s an example on the page linked of using a beta channel.

It’s not ideal but could work for your scenario.

1 Like

Inject js in the webview through a custom plugin, so skip the angular part for some areas.

Or check a js framework that do this smoothly and use ionic4

Just a thought.