Hi,
We're trying to work out how to have different splash screens depending on a JavaScript variable. We don't think this is is possible but we thought we'd throw this out to see if the wisdom of the group can identify a solution.
Background
Our core software is actually a two apps in one. Jambuster and Jambuster Blackwall Tunnel. Both apps are free, both share around 90% of the same functionality but the Jambuster Blackwall Tunnel app is dedicated for traffic issues around a certain location in London. The main Jambuster app isn't a Pro version and the Jambuster Blackwall Tunnel version isn't a Lite version, it's just a change in specialism. They have slightly different target markets and the Jambuster Blackwall Tunnel app has some predefined sections that simplify life for people who drive through the Blackwall Tunnel in London regularly.
This model allows us to expand out horizontally so we can put out apps based on different areas of London as the traffic patterns vary over London.
The software for both apps is the same, we configure the apps based on:
1. A rather complex build system that ensures that both apps have a common codebase. We have two app directories and we basically use symbolic links to ensure that the code files are up to date and are perfectly (we almost never use that word, but here we will) in line.
2. A single variable change in a JavaScript configuration file changes the functional characteristics of the two apps. This works very well.
3. We have individual config.xml files as the app id needs to be different, along with the splashscreens configuration and some low level license keys for commercial plugins.
Based on this setup, which has evolved as we find issues, we can build and test two apps for Android and IOS, so four separate apps, in a few minutes. It may not work for everybody and has rather a lot of shell scripts underpinning it, but for us its been pretty good for the last 12 months. We haven't changed it in 12 months so we know it works pretty seamlessly.
What we want to do
We're about to change a key element of our app, our map displays. We used to use Open Streetmap (OSM). We have our own OSM server and we know it pretty well. However OSM doesn't do real time traffic information which is a problem. We have a commercial provider, HERE, who does, so we will test using that. The code to switch between OSM and HERE maps is, you guessed it, a single JavaScript variable change. We wanted to ensure that we can change map providers easily and quickly as we may use the traffic volumes as a discriminator in future products. We may end up with a Pro version which has traffic displayed and a cheaper version that doesn't.
All the map display code is changed (took about 8 hours) but we have one niggling problem left.
Our splash screens use images from OpenStreetMap which has a different colour set and style to HERE maps. It's not a problem to create new splash screens using the HERE maps, that's already done, but what we really want to do is have both sets of splashscreens in the app, and depending on the app configuration we choose at boot time, which one to display.
We know we can write a shell script that pulls one set of splash screen images out of the build directory and replaces them with a different set. Thats pretty simple, but we would much prefer to have a system such that the program itself does this at run time rather than the decision made at build time. That's a key difference.
We are strong believers in very adaptable, self configuration code. We like having a simple one variable change and slightly different functionality kicks in. Whilst the up front costs of time are more, the long term maintenance is less.
What have we done
We've looked through the main Splash Screen plugin
and can see that it doesn't appear to support what we need to do. Our thinking about the way Cordova works is that there is some behind the scenes work that is done BEFORE the isDeviceReady event is kicked off to our main app, which is why the splash screen code is in the config.xml file, rather than the JavaScript files.
We don't think it's possible to change the splash screens in this way and we think we have to write a script to do it at build time rather than run time, but if there is any way to do it, this is the group that can prove us wrong.
Thanks
Rob