Is PhoneGap on iOS hardcoded to download www / index.html?

In PhoneGap on Android, you can change the App.java class to load any URL. I can not find anywhere to change the entry point to the iOS version.

When testing, I prefer to have several "www" directories with different settings. For now, I need to rename directories that are a bit unpleasant.

+8
ios cordova
source share
4 answers

You can do it:

Create a default index.html index and run it and upload your own custom html root file so you can save your directory structure and not make any changes there.

Of course, the phone book is open source, so you can also make changes to the phone difference to change the iOS api, similar to the Android API. Currently it seems that the root html file path is defined in the PhoneGapDelegate.m class

+5
source share

As with PhoneGap 2.2, you can now override the <content> in config.xml :

 <content src="http://www.example.com" /> 
+14
source share

PhoneGapDelegate.h defines the startPage method of the class, which you can overload / override in the AppDelegate.m file of the iOS application.

 + (NSString*) startPage; 

For example:

 + (NSString*) startPage{ return @"http://m.google.com"; } 

Will override the start page in PhoneGap. You will need to add google.com to your external addresses in PhoneGap.plist. Starting with PhoneGap 1.2. If you do this and enable plugins in your own application, remote PhoneGap applications and their associated * .js will be able to prefix the actions of the plugin. I checked this with BarcodeScanner, ChildBrowser and ApplicationPreferences.

UPDATE

Starting with 1.4.0 and 1.4.0, startPage and wwwFolderName are properties instead of methods. They are still overridden, but you can no longer have startPage for remote (non-local) installation of a phone screen saver, as in my example above. (What a bummer)

+8
source share

you could do it

class / AppDelegate.m

change self.viewController.startPage for the start page in AppDelegate.m

+1
source share

All Articles