Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4875B1888A for ; Wed, 3 Feb 2016 01:10:43 +0000 (UTC) Received: (qmail 46342 invoked by uid 500); 3 Feb 2016 01:10:27 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 46301 invoked by uid 500); 3 Feb 2016 01:10:27 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 46290 invoked by uid 99); 3 Feb 2016 01:10:26 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Feb 2016 01:10:26 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CCC07DFC88; Wed, 3 Feb 2016 01:10:26 +0000 (UTC) From: omefire To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org References: In-Reply-To: Subject: [GitHub] cordova-docs pull request: CB-10389: Turning config.xml documentat... Content-Type: text/plain Message-Id: <20160203011026.CCC07DFC88@git1-us-west.apache.org> Date: Wed, 3 Feb 2016 01:10:26 +0000 (UTC) Github user omefire commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/463#discussion_r51664771 --- Diff: www/docs/en/dev/config_ref/index.md --- @@ -45,207 +45,356 @@ passively copied into various `platforms/` subdirectories, for example: app/platforms/blackberry10/www/config.xml app/platforms/android/res/xml/config.xml -This section details global and cross-platform configuration options. -See the following sections for platform-specific options: - -- [iOS Configuration](../guide/platforms/ios/config.html) -- [Android Configuration](../guide/platforms/android/config.html) -- [BlackBerry 10 Configuration](../guide/platforms/blackberry10/config.html) - In addition to the various configuration options detailed below, you can also configure an application's core set of images for each target platform. See [Icons and Splash Screens](images.html) for more information. -## Core Configuration Elements - -This example shows the default `config.xml` generated by the CLI's -`create` command, described in [The Command-Line Interface](../guide/cli/index.html): - - - HelloWorld - - A sample Apache Cordova application that responds to the deviceready event. - - - Apache Cordova Team - - - - - -The following configuration elements appear in the top-level -`config.xml` file, and are supported across all supported Cordova -platforms: - -- The `` element's `id` attribute provides the app's - reverse-domain identifier, and the `version` its full version number - expressed in major/minor/patch notation. - - The widget tag can also have attributes that specify alternative versions, - namely `versionCode` for Android, `CFBundleVersion` for iOS, and - `packageVersion` for Windows. See the Additional Versioning section below - for details. - -- The `` element specifies the app's formal name, as it appears - on the device's home screen and within app-store interfaces. - -- The `` and `` elements specify metadata and - contact information that may appear within app-store listings. - -- The optional `` element defines the app's starting - page in the top-level web assets directory. The default value is - `index.html`, which customarily appears in a project's top-level - `www` directory. - -- `` elements define the set of external domains the app is - allowed to communicate with. The default value shown above allows - it to access any server. See the Domain [Whitelist Guide](../guide/appdev/whitelist/index.html) for details. - -- The `` tag sets various options as pairs of - `name`/`value` attributes. Each preference's `name` is - case-insensitive. Many preferences are unique to specific - platforms, as listed at the top of this page. The following sections - detail preferences that apply to more than one platform. - -### Additional Versioning +# widget + Root element of the config.xml document. + + Attributes(type) | Description + ---------------- | ------------ + id (string) | *Required: true*
Specifies the app's reverse-domain identifier, and the `version` its full version number expressed in major/minor/patch notation. + version (string) | *Required: true*
Full version number expressed in major/minor/patch notation. + versionCode (string) | *Required: false*
**Platforms supported: Android**
Alternative version for Android. + CFBundleVersion (string) | *Required: false*
**Platforms supported: iOS**
Alternative version for iOS. + packageVersion (string) | *Required: false*
**Platforms supported: Windows**
Alternative version for Windows. + packageName (string) | *Default: Cordova.Example*
**Platforms supported: Windows**
Package name for Windows. + xmlns (string) | *Required: true*
namespace for the config.xml document. + xmlns:cdv (string) | *Required: true*
namespace prefix. + + Examples: -Android, iOS, and Windows support a second version string (or number) in -addition to the one visible in app stores: + + -- [versionCode](http://developer.android.com/tools/publishing/versioning.html) - for Android -- [CFBundleVersion](http://stackoverflow.com/questions/4933093/cfbundleversion-in-the-info-plist-upload-error) - for iOS -- [packageVersion](https://msdn.microsoft.com/en-us/library/windows/apps/br211441.aspx) - for Windows + + -Below is an example that explicitly sets these properties: + + + - + + + -If alternative version is not specified, the following -defaults will be used: + + + - // assuming version = MAJOR.MINOR.PATCH-whatever - versionCode = PATCH + MINOR * 100 + MAJOR * 10000 - CFBundleVersion = "MAJOR.MINOR.PATCH" - packageVersion = "MAJOR.MINOR.PATCH.0" + + -## Global Preferences -The following global preferences apply to all platforms: +## name + Specifies the app's formal name, as it appears on the device's home screen and within app-store interfaces. -- `Fullscreen` allows you to hide the status bar at the top of the - screen. The default value is `false`. Example: + Example: - + + HelloCordova + + +## description + Specifies metadata that may appear within app-store listings. -## Multi-Platform Preferences + Example: + + + A sample Apache Cordova application + -The following preferences apply to more than one platform, but not to -all of them: + +## author + Specifies contact information that may appear within app-store lisitngs. + + Attributes (type) | Description + ----------------- | ------------ + email (string) | *Required: true
* Email of the author. + href (string) | *Required: true
* Website of the author. -- `DisallowOverscroll` (boolean, defaults to `false`): set to `true` - if you don't want the interface to display any feedback when users - scroll past the beginning or end of content. + Examples: - + + + - Applies to Android and iOS. On iOS, overscroll gestures cause - content to bounce back to its original position. On Android, they - produce a more subtle glowing effect along the top or bottom edge of - the content. + +## content + Optional. + Defines the app's starting page in the top-level web assets directory. The default value is index.html, which customarily + appears in a project's top-level www directory. + + Attributes (type) | Description + ----------------- | ------------ + src (string) | *Required: true
* Defines the app's starting page in the top-level web assets directory. The default value is index.html, which customarily + appears in a project's top-level www directory. + + Example: + + + + -- `BackgroundColor`: Set the app's background color. Supports a - four-byte hex value, with the first byte representing the alpha - channel, and standard RGB values for the following three bytes. This - example specifies blue: + +## access + Defines the set of external domains the app is allowed to communicate with. The default value shown above allows it to access any server. + See the Domain [Whitelist Guide](../guide/appdev/whitelist/index.html) for details. - + Attributes (type) | Description + ----------------- | ------------ + origin (string) | *Required: true
* Defines the set of external domains the app is allowed to communicate with. + The default value shown above allows it to access any server. + See the Domain [Whitelist Guide](../guide/appdev/whitelist/index.html) for details. - Applies to Android and BlackBerry. Overrides CSS otherwise available - across _all_ platforms, for example: `body{background-color:blue}`. + Examples: -- `HideKeyboardFormAccessoryBar` (boolean, defaults to `false`): set - to `true` to hide the additional toolbar that appears above the - keyboard, helping users navigate from one form input to another. + +
+
+ + + + + + +## allow-navigation + Controls which URLs the WebView itself can be navigated to. Applies to top-level navigations only. + + Attributes (type) | Description + ----------------- | ------------ + href (string) | *Required: true*
Defines the set of external domains the WebView is allowed to navigate to. + See the cordova-plugin-whitelist [cordova-plugin-whitelist](https://github.com/apache/cordova-plugin-whitelist#navigation-whitelist) for details. + + Examples: + + + + + + + +## allow-intent + Controls which URLs the app is allowed to ask the system to open. By default, no external URLs are allowed. + + Attributes (type) | Description + ----------------- | ------------ + href (string) | *Required: true*
Defines which URLs the app is allowed to ask the system to open. + See the cordova-plugin-whitelist [cordova-plugin-whitelist](https://github.com/apache/cordova-plugin-whitelist#intent-whitelist) for details. + + Examples: + + + + + + +## engine + Specifies what platform to restore during a prepare. For more details, see the Platforms & Plugins Version Management. + + Attributes (type) | Description + ----------------- | ------------ + name (string) | *Required: true*
Name of the platform to be restored + spec (string) | *Required: true*
Version of the platform to be restored + + Examples: + + + +## preference + Sets various optinos as pairs of name/value attributes. Each preference's name is case-insensitive. Many preferences are unique to specific platforms, + and will be indicated as such. + + Attributes (type) | Description + ----------------- | ------------ + DisallowOverscroll (boolean) | *Default: false*
**Platforms supported: iOS, Android**
Set to **true** if you don't want the interface to display any feedback when users scroll past the beginning or end of content. On iOS, overscroll gestures cause content to bounce back to its original position. on Android, they produce a more subtle glowing effect along the top or bottom edge of the content.
+ FullScreen (boolean) | *Default: false*
Allows you to hide the status bar at the top of the screen. + BackgroundColor (string) | *Required: false*
**Platforms supported: Android, BlackBerry**
Supports a four-byte hex value, with the first byte representing the alpha channel, and standard RGB values for the following three bytes. + HideKeyboardFormAccessoryBar (boolean) | *Default: false*
**Platforms supported: BlackBerry**
set to true to hide the additional toolbar that appears above the keyboard, helping users navigate from one form input to another. + Orientation (string) | *Default: default*
Allowed values: default, landscape, portait
Allows you to lock orientation and prevent the interface from rotating in response to changes in orientation.
**NOTE:** The default value means Cordova will strip the orientation preference entry from the platform's manifest/configuration file allowing the platform to fallback to its default behavior. For iOS, to specify both portrait & landscape mode you would use the platform specific value 'all'. + EnableViewportScale (boolean) | *Default: false*
**Platforms supported: iOS**
Set to true to allow a viewport meta tag to either disable or restrict the range of user scaling, which is enabled by default. Place a viewport such as the following in the HTML to disable scaling and fit content flexibly within the rendering WebView:
`````` + MediaPlaybackAllowsAirPlay (boolean) | *Default: true*
**Platforms supported: iOS**
Set to false to prevent Air Play from being used in this view. Available in default UIWebView and WKWebView. + MediaPlaybackRequiresUserAction (boolean) | *Default: false*
**Platforms supported: iOS**
Set to true to prevent HTML5 videos or audios from playing automatically with the autoplay attribute or via JavaScript. + AllowInlineMediaPlayback (boolean) | *Default: false*
**Platforms supported: iOS**
Set to true to allow HTML5 media playback to appear inline within the screen layout, using browser-supplied controls rather than native controls. For this to work, add the webkit-playsinline attribute to any ```