I am having a problem using the command line tool cordova-cli.
I have followed every step from the documentation:
$ cordova create ~/test com.test test
In this step I want to change the contents of the www
folder:
1-Move the sample web page under a src
folder. So the contents of the www
are:
--www/ |-- config.xml |-- src/
2-Edit the config.xml with my data and change the content
tag to point the correct path of the index.html
:
<widget id="com.test" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Test</name>
<description>
Test
</description>
<author email="[email protected]" href="http://sample.com/">
Foo Bar
</author>
<content src="src/index.html"/>
<access origin="*" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
</widget>
With this file changed I continue with the general steps (from the root of the project):
Add iOS platform:
$ cordova platform add ios
And then build the project:
$ cordova build
Now, if I open the project under test/platforms/ios/test
I see a config.xml with a default content as:
<widget id="io.cordova.helloCordova" version="2.0.0" xmlns="http://www.w3.org/ns/widgets">
<name>Hello Cordova</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="[email protected]" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />
<feature name="LocalStorage">
<param name="ios-package" value="CDVLocalStorage" />
</feature>
<access origin="*" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
<preference name="SuppressesIncrementalRendering" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="TopActivityIndicator" value="gray" />
<preference name="EnableLocation" value="false" />
<preference name="EnableViewportScale" value="false" />
<preference name="AutoHideSplashScreen" value="true" />
<preference name="ShowSplashScreenSpinner" value="true" />
<preference name="MediaPlaybackRequiresUserAction" value="false" />
<preference name="AllowInlineMediaPlayback" value="false" />
<preference name="OpenAllWhitelistURLsInWebView" value="false" />
<preference name="BackupWebStorage" value="cloud" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="false" />
</widget>
Notice that UIWebViewBounce
preference is correct, but the content
tag is incorrect, as well as the author
tag, description
and name
.
If then I run the app it fails, as it tries to open the www/index.html
instead of www/src/index.html
.
Am I doing something wrong?
NOTE
The contents of the test/www
is copied correctly into test/platforms/ios/www
.
This is not a real answer, but I opened two tickets in Cordova's JIRA regarding this problem here and here.
Currently Cordova client does not
support this features in the config.xml
. You will need to modify the icons and splashscreens manually at this time as well the content
tag in every platform project. Notice that you only have to do this once as Cordova maintain the config.xml
changes and other resources as images.
Likely, a next version will include these features.
More info:
UPDATE:
It seems that this issue has been solved in this pull request. It will available in the next release of Cordova.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With