Reputation: 560
I want to have multiple targets in my Phonegap Xcode project that share resources but load from a different index.html file.
The index file that is loaded is determined by the config.xml file.
How can I define a different config.xml file or a different index.html file for these different targets.
Alternatively, is there a better way to apply settings, and deploy an app that is 99.9% the same?
I'm using Cordova 2.8.1.
Thank you.
Upvotes: 0
Views: 1276
Reputation: 36
PhoneGap's CDVViewController.m
reads config.xml
from the main bundle, so you can
config.xml
for each target in the associated directory from step 1.config.xml
from step 2 to the correct target.If the only difference is the starting HTML file, you could modify your AppDelegate.m
and use a compile-time constant to define the starting page:
self.viewController.startPage = [NSString stringWithFormat:@"%s", START_HTML_FILE];
To set the compile time constant, go into Build Phases tab in Xcode for each target and use the -D
compiler flag. For example:
-DSTART_HTML_FILE=\"target1-index.html\"
Upvotes: 2