Modified: cordova/site/public/docs/en/dev/reference/cordova-plugin-console/index.html URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/dev/reference/cordova-plugin-console/index.html?rev=1812550&r1=1812549&r2=1812550&view=diff ============================================================================== --- cordova/site/public/docs/en/dev/reference/cordova-plugin-console/index.html (original) +++ cordova/site/public/docs/en/dev/reference/cordova-plugin-console/index.html Wed Oct 18 16:49:57 2017 @@ -2750,16 +2750,6 @@ <h1>cordova-plugin-console</h1> -<h2>Deprecated</h2> - -<blockquote> -<p>This plugin is no longer being worked on as the functionality provided by this plugin is now included in cordova-ios 4.5.0 or greater, and support is already built in to cordova-windows > 5.0.0. You should remove this plugin from your applications.</p> - -<p>Please file issues for this plugin against their respective platforms (cordova-ios, cordova-windows).</p> -</blockquote> - -<h2>Description</h2> - <p>This plugin is meant to ensure that console.log() is as useful as it can be. It adds additional function for iOS, Ubuntu, Windows Phone 8, and Windows. If you are happy with how console.log() works for you, then you probably
Modified: cordova/site/public/docs/en/dev/reference/cordova-plugin-device-motion/index.html URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/dev/reference/cordova-plugin-device-motion/index.html?rev=1812550&r1=1812549&r2=1812550&view=diff ============================================================================== --- cordova/site/public/docs/en/dev/reference/cordova-plugin-device-motion/index.html (original) +++ cordova/site/public/docs/en/dev/reference/cordova-plugin-device-motion/index.html Wed Oct 18 16:49:57 2017 @@ -2750,14 +2750,6 @@ <h1>cordova-plugin-device-motion</h1> -<h1>Deprecation Notice</h1> - -<p>With the <a href="https://www.w3.org/TR/2016/CR-orientation-event-20160818/">W3C Device Motion and Orientation API</a> now being supported on iOS, Android and Windows devices, this plugin is not needed any more. Migrating from this plugin to the <a href="https://www.w3.org/TR/2016/CR-orientation-event-20160818/">W3C Device Motion and Orientation API</a> is explained in this <a href="https://blog.phonegap.com/migrating-from-the-cordova-device-motion-plugin-ddd8176632ed">PhoneGap blog post</a>.</p> - -<hr> - -<h2>Description</h2> - <p>This plugin provides access to the device's accelerometer. The accelerometer is a motion sensor that detects the change (<em>delta</em>) in movement relative to the current device orientation, in three dimensions along the <em>x</em>, <em>y</em>, and <em>z</em> Modified: cordova/site/public/docs/en/dev/reference/cordova-plugin-device-orientation/index.html URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/dev/reference/cordova-plugin-device-orientation/index.html?rev=1812550&r1=1812549&r2=1812550&view=diff ============================================================================== --- cordova/site/public/docs/en/dev/reference/cordova-plugin-device-orientation/index.html (original) +++ cordova/site/public/docs/en/dev/reference/cordova-plugin-device-orientation/index.html Wed Oct 18 16:49:57 2017 @@ -2750,17 +2750,6 @@ <h1>cordova-plugin-device-orientation</h1> -<h1>Deprecation Notice</h1> - -<p>With the <a href="https://www.w3.org/TR/2016/CR-orientation-event-20160818/">W3C Device Orientation API</a> now being -supported on iOS, Android and Windows devices, this plugin is not needed any more. Migrating from this plugin to -the <a href="https://www.w3.org/TR/2016/CR-orientation-event-20160818/">W3C Device Orientation API</a> is explained in this -<a href="https://blog.phonegap.com/migrating-from-the-cordova-device-orientation-plugin-8442b869e6cc">PhoneGap blog post</a>.</p> - -<hr> - -<h2>Description</h2> - <p>This plugin provides access to the device's compass. The compass is a sensor that detects the direction or heading that the device is pointed, typically from the top of the device. It measures the heading in degrees from 0 to @@ -2774,7 +2763,7 @@ function onDeviceReady() { console.log(navigator.compass); } </code></pre></div> -<p>Report issues on the <a href="https://issues.apache.org/jira/secure/RapidBoard.jspa?rapidView=190&projectKey=CB">Apache Cordova issue tracker</a></p> +<p>Report issues on the <a href="https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Device%20Orientation%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC">Apache Cordova issue tracker</a></p> <h2>Installation</h2> <div class="highlight"><pre><code class="language-" data-lang="">cordova plugin add cordova-plugin-device-orientation Modified: cordova/site/public/docs/en/dev/reference/cordova-plugin-file-transfer/index.html URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/dev/reference/cordova-plugin-file-transfer/index.html?rev=1812550&r1=1812549&r2=1812550&view=diff ============================================================================== --- cordova/site/public/docs/en/dev/reference/cordova-plugin-file-transfer/index.html (original) +++ cordova/site/public/docs/en/dev/reference/cordova-plugin-file-transfer/index.html Wed Oct 18 16:49:57 2017 @@ -2823,7 +2823,7 @@ multi-part POST or PUT request, and to d <li><strong>chunkedMode</strong>: Whether to upload the data in chunked streaming mode. Defaults to <code>true</code>. (Boolean)</li> <li><strong>headers</strong>: A map of header name/header values. Use a hash to specify one or more than one value. On iOS, FireOS, and Android, if a header named Content-Type is present, multipart form data will NOT be used. (Object)</li> </ul></li> -<li><p><strong>trustAllHosts</strong>: Optional parameter, defaults to <code>false</code>. If set to <code>true</code>, it accepts all security certificates. Not recommended for production use. Supported on iOS. <em>(boolean)</em></p></li> +<li><p><strong>trustAllHosts</strong>: Optional parameter, defaults to <code>false</code>. If set to <code>true</code>, it accepts all security certificates. This is useful since Android rejects self-signed security certificates. Not recommended for production use. Supported on Android and iOS. <em>(boolean)</em></p></li> </ul> <h3>Example</h3> @@ -2937,7 +2937,7 @@ multi-part POST or PUT request, and to d <li><p><strong>target</strong>: Filesystem url representing the file on the device. For backwards compatibility, this can also be the full path of the file on the device. (See <a href="#backwards-compatibility-notes">Backwards Compatibility Notes</a> below)</p></li> <li><p><strong>successCallback</strong>: A callback that is passed a <code>FileEntry</code> object. <em>(Function)</em></p></li> <li><p><strong>errorCallback</strong>: A callback that executes if an error occurs when retrieving the <code>FileEntry</code>. Invoked with a <code>FileTransferError</code> object. <em>(Function)</em></p></li> -<li><p><strong>trustAllHosts</strong>: Optional parameter, defaults to <code>false</code>. If set to <code>true</code>, it accepts all security certificates. Not recommended for production use. Supported on iOS. <em>(boolean)</em></p></li> +<li><p><strong>trustAllHosts</strong>: Optional parameter, defaults to <code>false</code>. If set to <code>true</code>, it accepts all security certificates. This is useful because Android rejects self-signed security certificates. Not recommended for production use. Supported on Android and iOS. <em>(boolean)</em></p></li> <li><p><strong>options</strong>: Optional parameters, currently only supports headers (such as Authorization (Basic Authentication), etc).</p></li> </ul> Modified: cordova/site/public/docs/en/dev/reference/cordova-plugin-inappbrowser/index.html URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/dev/reference/cordova-plugin-inappbrowser/index.html?rev=1812550&r1=1812549&r2=1812550&view=diff ============================================================================== --- cordova/site/public/docs/en/dev/reference/cordova-plugin-inappbrowser/index.html (original) +++ cordova/site/public/docs/en/dev/reference/cordova-plugin-inappbrowser/index.html Wed Oct 18 16:49:57 2017 @@ -2779,7 +2779,7 @@ effects (especially if this plugin is in plugin). The hook of <code>window.open</code> will be removed in a future major release. Until the hook is removed from the plugin, apps can manually restore the default behaviour:</p> -<div class="highlight"><pre><code class="language-" data-lang="">delete window.open // Reverts the call back to its prototype's default +<div class="highlight"><pre><code class="language-" data-lang="">delete window.open // Reverts the call back to it's prototype's default </code></pre></div> <p>Although <code>window.open</code> is in the global scope, InAppBrowser is not available until after the <code>deviceready</code> event.</p> <div class="highlight"><pre><code class="language-" data-lang="">document.addEventListener("deviceready", onDeviceReady, false); Modified: cordova/site/public/docs/en/dev/reference/cordova-plugin-statusbar/index.html URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/dev/reference/cordova-plugin-statusbar/index.html?rev=1812550&r1=1812549&r2=1812550&view=diff ============================================================================== --- cordova/site/public/docs/en/dev/reference/cordova-plugin-statusbar/index.html (original) +++ cordova/site/public/docs/en/dev/reference/cordova-plugin-statusbar/index.html Wed Oct 18 16:49:57 2017 @@ -2871,7 +2871,6 @@ StatusBar.overlaysWebView(false); <ul> <li>iOS</li> -<li>Android 6+ </li> <li>Windows Phone 7</li> <li>Windows Phone 8</li> <li>Windows Phone 8.1</li> @@ -2886,7 +2885,6 @@ StatusBar.overlaysWebView(false); <ul> <li>iOS</li> -<li>Android 6+ </li> <li>Windows Phone 7</li> <li>Windows Phone 8</li> <li>Windows Phone 8.1</li> @@ -2901,7 +2899,6 @@ StatusBar.overlaysWebView(false); <ul> <li>iOS</li> -<li>Android 6+ </li> <li>Windows Phone 7</li> <li>Windows Phone 8</li> <li>Windows Phone 8.1</li> @@ -2916,7 +2913,6 @@ StatusBar.overlaysWebView(false); <ul> <li>iOS</li> -<li>Android 6+ </li> <li>Windows Phone 7</li> <li>Windows Phone 8</li> <li>Windows Phone 8.1</li> Modified: cordova/site/public/feed.xml URL: http://svn.apache.org/viewvc/cordova/site/public/feed.xml?rev=1812550&r1=1812549&r2=1812550&view=diff ============================================================================== --- cordova/site/public/feed.xml (original) +++ cordova/site/public/feed.xml Wed Oct 18 16:49:57 2017 @@ -6,11 +6,191 @@ </description> <link>https://cordova.apache.org/</link> <atom:link href="https://cordova.apache.org/feed.xml" rel="self" type="application/rss+xml"/> - <pubDate>Tue, 17 Oct 2017 11:26:29 -0700</pubDate> - <lastBuildDate>Tue, 17 Oct 2017 11:26:29 -0700</lastBuildDate> + <pubDate>Wed, 18 Oct 2017 10:28:05 -0500</pubDate> + <lastBuildDate>Wed, 18 Oct 2017 10:28:05 -0500</lastBuildDate> <generator>Jekyll v2.5.3</generator> <item> + <title>Transition off of cordova-plugin-file-transfer</title> + <description><p>Early on in Cordova&#39;s existence, the <a href="https://github.com/apache/cordova-plugin-file-transfer">file-transfer plugin</a> +was created to solve the <a href="https://issues.apache.org/jira/browse/CB-22">problem of downloading binary files</a>. +At the time, there weren&#39;t great options for solving this using standards-compliant +web APIs. The web took a twisty path to get to a solution (see +<a href="https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/sendAsBinary">Firefox&#39;s <code>sendAsBinary</code></a> +and the now-defunct <a href="https://dev.w3.org/2009/dap/file-system/file-dir-sys.html">FileSystem API</a>&#39;s +<a href="https://developer.mozilla.org/en-US/docs/Web/API/BlobBuilder">BlobBuilder</a>, +among others), but today you can use our good friend <a href="https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest">XMLHttpRequest</a>&#39;s +newest features, combined with some newer JavaScript types and objects, +<a href="https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data">to solve this problem</a>. +This is an exciting moment for Cordova as the dream for this project was always +to eventually reduce the surface area of APIs the project maintains, and instead +see regular web APIs be able to handle these use cases.</p> + +<p>As a result, +<a href="https://issues.apache.org/jira/browse/CB-13052">Cordova is sunsetting the file-transfer plugin</a>. +What does &quot;sunsetting&quot; mean? In summary:</p> + +<ul> +<li>No more work will be done on the file-transfer plugin by the Cordova development +community.</li> +<li>You can continue to use the file-transfer plugin if you wish - it should work +fine as-is for the foreseeable future.</li> +<li>We highly suggest Cordova users transition to using the +<a href="https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data">standards-compliant way of sending and receiving binary data</a>.</li> +</ul> + +<p>All of us at Apache Cordova don&#39;t want to leave y&#39;all hanging, though, so we +thought it&#39;d be a good idea to show you how to use these newer XHR features to do +what file-transfer lets you do, but in a way that will work in any modern web +browser to boot!</p> + +<h2>Requirements</h2> + +<p>Based on how deeply you interact with the underlying device filesystem, and on +which platforms, you may still need to rely on the +<a href="https://github.com/apache/cordova-plugin-file">Cordova File plugin</a>. If you +still have references to <code>requestFileSystem</code> or <code>root.fs</code> in your application&#39;s +JavaScript, you will definitely need the File plugin because these are not +standards-compliant APIs. Take note and care!</p> + +<h2>Platform Support</h2> + +<p>Binary types in JavaScript, as well as the extended XHR features, are available +on the following Cordova-supported platforms without requiring any additional +plugins:</p> + +<ul> +<li>Android 4.4 or newer.</li> +<li>iOS 10 or newer.</li> +<li>Windows UWP (8.1, 10 or newer all work).</li> +<li>Windows Phone 8 or newer.</li> +</ul> + +<p>As always, check <a href="https://caniuse.com">caniuse.com</a> for detailed support for the +required bits, like <a href="http://caniuse.com/#feat=blobbuilder"><code>Blob</code></a>, +<a href="http://caniuse.com/#feat=typedarrays">Typed Arrays</a>, and +<a href="http://caniuse.com/#feat=xhr2">extended XHR features</a>.</p> + +<h2>TL;DR</h2> + +<p>Standards are great and all, but what do you actually have to copy-paste to replace +the previous FileTransfer examples? We have you covered:</p> + +<p>Here&#39;s a replacement for +<a href="https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file-transfer/index.html#download-a-binary-file-to-the-application-cache">FileTransfer&#39;s &quot;Download a Binary File&quot; example</a>:</p> +<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="nb">window</span><span class="p">.</span><span class="nx">requestFileSystem</span><span class="p">(</span><span class="nx">LocalFileSystem</span><span class="p">.</span><span class="nx">PERSISTENT</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">fs</span><span class="p">)</span> <span class="p">{</span> + <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">'file system open: '</span> <span class="o">+</span> <span class="nx">fs</span><span class="p">.</span><span class="nx">name</span><span class="p">);</span> + <span class="nx">fs</span><span class="p">.</span><span class="nx">root</span><span class="p">.</span><span class="nx">getFile</span><span class="p">(</span><span class="s1">'bot.png'</span><span class="p">,</span> <span class="p">{</span> <span class="na">create</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="na">exclusive</span><span class="p">:</span> <span class="kc">false</span> <span class="p">},</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">fileEntry</s pan><span class="p">)</span> <span class="p">{</span> + <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">'fileEntry is file? '</span> <span class="o">+</span> <span class="nx">fileEntry</span><span class="p">.</span><span class="nx">isFile</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span> + <span class="kd">var</span> <span class="nx">oReq</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">XMLHttpRequest</span><span class="p">();</span> + <span class="c1">// Make sure you add the domain name to the Content-Security-Policy &lt;meta&gt; element.</span> + <span class="nx">oReq</span><span class="p">.</span><span class="nx">open</span><span class="p">(</span><span class="s2">"GET"</span><span class="p">,</span> <span class="s2">"http://cordova.apache.org/static/img/cordova_bot.png"</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span> + <span class="c1">// Define how you want the XHR data to come back</span> + <span class="nx">oReq</span><span class="p">.</span><span class="nx">responseType</span> <span class="o">=</span> <span class="s2">"blob"</span><span class="p">;</span> + <span class="nx">oReq</span><span class="p">.</span><span class="nx">onload</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">oEvent</span><span class="p">)</span> <span class="p">{</span> + <span class="kd">var</span> <span class="nx">blob</span> <span class="o">=</span> <span class="nx">oReq</span><span class="p">.</span><span class="nx">response</span><span class="p">;</span> <span class="c1">// Note: not oReq.responseText</span> + <span class="k">if</span> <span class="p">(</span><span class="nx">blob</span><span class="p">)</span> <span class="p">{</span> + <span class="c1">// Create a URL based on the blob, and set an &lt;img&gt; tag's src to it.</span> + <span class="kd">var</span> <span class="nx">url</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">URL</span><span class="p">.</span><span class="nx">createObjectURL</span><span class="p">(</span><span class="nx">blob</span><span class="p">);</span> + <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'bot-img'</span><span class="p">).</span><span class="nx">src</span> <span class="o">=</span> <span class="nx">url</span><span class="p">;</span> + <span class="c1">// Or read the data with a FileReader</span> + <span class="kd">var</span> <span class="nx">reader</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">FileReader</span><span class="p">();</span> + <span class="nx">reader</span><span class="p">.</span><span class="nx">addEventListener</span><span class="p">(</span><span class="s2">"loadend"</span><span class="p">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> + <span class="c1">// reader.result contains the contents of blob as text</span> + <span class="p">});</span> + <span class="nx">reader</span><span class="p">.</span><span class="nx">readAsText</span><span class="p">(</span><span class="nx">blob</span><span class="p">);</span> + <span class="p">}</span> <span class="k">else</span> <span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span><span class="s1">'we didnt get an XHR response!'</span><span class="p">);</span> + <span class="p">};</span> + <span class="nx">oReq</span><span class="p">.</span><span class="nx">send</span><span class="p">(</span><span class="kc">null</span><span class="p">);</span> + <span class="p">},</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span> <span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span><span class="s1">'error getting file! '</span> <span class="o">+</span> <span class="nx">err</span><span class="p">);</span> <span class="p">});</span> +<span class="p">},</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span> <span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span><span class="s1">'error getting persistent fs! '</span> <span class="o">+</span> <span class="nx">err</span><span class="p">);</span> <span class="p">});</span> +</code></pre></div> +<p>Here&#39;s a similar replacement for +<a href="https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file-transfer/index.html#uploadFile">FileTransfer&#39;s &quot;Upload a File&quot; example</a>:</p> +<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="nb">window</span><span class="p">.</span><span class="nx">requestFileSystem</span><span class="p">(</span><span class="nx">LocalFileSystem</span><span class="p">.</span><span class="nx">PERSISTENT</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">fs</span><span class="p">)</span> <span class="p">{</span> + <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">'file system open: '</span> <span class="o">+</span> <span class="nx">fs</span><span class="p">.</span><span class="nx">name</span><span class="p">);</span> + <span class="nx">fs</span><span class="p">.</span><span class="nx">root</span><span class="p">.</span><span class="nx">getFile</span><span class="p">(</span><span class="s1">'bot.png'</span><span class="p">,</span> <span class="p">{</span> <span class="na">create</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="na">exclusive</span><span class="p">:</span> <span class="kc">false</span> <span class="p">},</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">fileEntry</s pan><span class="p">)</span> <span class="p">{</span> + <span class="nx">fileEntry</span><span class="p">.</span><span class="nx">file</span><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">file</span><span class="p">)</span> <span class="p">{</span> + <span class="kd">var</span> <span class="nx">reader</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">FileReader</span><span class="p">();</span> + <span class="nx">reader</span><span class="p">.</span><span class="nx">onloadend</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> + <span class="c1">// Create a blob based on the FileReader "result", which we asked to be retrieved as an ArrayBuffer</span> + <span class="kd">var</span> <span class="nx">blob</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Blob</span><span class="p">([</span><span class="k">new</span> <span class="nb">Uint8Array</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">result</span><span class="p">)],</span> <span class="p">{</span> <span class="na">type</span><span class="p">:</span> <span class="s2">"image/png"</span> <span class="p">});</span> + <span class="kd">var</span> <span class="nx">oReq</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">XMLHttpRequest</span><span class="p">();</span> + <span class="nx">oReq</span><span class="p">.</span><span class="nx">open</span><span class="p">(</span><span class="s2">"POST"</span><span class="p">,</span> <span class="s2">"http://mysweeturl.com/upload_handler"</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span> + <span class="nx">oReq</span><span class="p">.</span><span class="nx">onload</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">oEvent</span><span class="p">)</span> <span class="p">{</span> + <span class="c1">// all done!</span> + <span class="p">};</span> + <span class="c1">// Pass the blob in to XHR's send method</span> + <span class="nx">oReq</span><span class="p">.</span><span class="nx">send</span><span class="p">(</span><span class="nx">blob</span><span class="p">);</span> + <span class="p">};</span> + <span class="c1">// Read the file as an ArrayBuffer</span> + <span class="nx">reader</span><span class="p">.</span><span class="nx">readAsArrayBuffer</span><span class="p">(</span><span class="nx">file</span><span class="p">);</span> + <span class="p">},</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span> <span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span><span class="s1">'error getting fileentry file!'</span> <span class="o">+</span> <span class="nx">err</span><span class="p">);</span> <span class="p">});</span> + <span class="p">},</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span> <span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span><span class="s1">'error getting file! '</span> <span class="o">+</span> <span class="nx">err</span><span class="p">);</span> <span class="p">});</span> +<span class="p">},</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span> <span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span><span class="s1">'error getting persistent fs! '</span> <span class="o">+</span> <span class="nx">err</span><span class="p">);</span> <span class="p">});</span> +</code></pre></div> +<p>Note that both the above examples rely on the File plugin, so if you remove the +FileTransfer plugin from your app, make sure to add the File plugin!</p> + +<h2>The Long Version</h2> + +<p>If you want to understand some of the nuts and bolts enabling binary data transferring, +you&#39;ll need to grasp two (possibly three) concepts. MDN has an absolutely fantastic +<a href="https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data">article</a> +on the topic that is worth a quick read, but I&#39;ll provide a summary here, too.</p> + +<h3>Binary Types in JavaScript</h3> + +<p>For the longest time, there was no way to directly represent binary data and +access the underlying bytes in memory within JavaScript. We could encode this data +in different formats (<a href="https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding">base64</a>, +anyone?), and that was cool, but just let me play with the bytes already. For +our purposes, we are interested in two objects in particular: +<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays">ArrayBuffer</a> +and <a href="https://developer.mozilla.org/en-US/docs/Web/API/Blob">Blob</a>. +Why do we care about these two? Because we can have XHRs return downloaded data +as these types, or pass these types directly to XHRs&#39; <code>send</code> method.</p> + +<h3>XHR</h3> + +<p>There are two newer XHR features, originally as part of what was referred to as +&quot;XHR2&quot; during its <a href="https://www.w3.org/TR/XMLHttpRequest2/">development</a>, that we +need to leverage to tie this all together.</p> + +<p>For downloading binary data, we need to set the +<a href="https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseType"><code>responseType</code></a> +property to either <code>arraybuffer</code> or <code>blob</code> - this tells XHR what type we want +the data we are retrieving back in. With <code>responseType</code> set, we can then access +the read-only <code>response</code> property to get either the <code>ArrayBuffer</code> or <code>Blob</code> +object representing the data retrieved by XHR.</p> + +<p>For uploading binary data, it is simpler: pass a <code>Blob</code> or <code>ArrayBuffer</code> directly +to XHR&#39;s <a href="https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Sending_binary_data"><code>send</code></a> +method. That&#39;s it.</p> + +<h2>Summary</h2> + +<p>Binary types and extended XHR features are well supported in modern desktop +browsers, and on recent-ish mobile browsers (and WebViews). For existing Cordova +users, as long as your app targets the platform and OS version combinations listed +above under Platform Support, you should be good to go! Remember that if you rely +on certain File plugin APIs like <code>requestFileSystem</code>, <code>root</code>, or <code>getFile</code>, +you&#39;ll need to ensure the File plugin is added to your app.</p> + +<p>Happy standards-compliant coding!</p> +</description> + <pubDate>Wed, 18 Oct 2017 00:00:00 -0500</pubDate> + <link>https://cordova.apache.org/blog/2017/10/18/from-filetransfer-to-xhr2.html</link> + <guid isPermaLink="true">https://cordova.apache.org/blog/2017/10/18/from-filetransfer-to-xhr2.html</guid> + + <category>plugins</category> + + + <category>blog</category> + + </item> + + <item> <title>Cordova iOS 4.5.2</title> <description><p>We are happy to announce a minor version of <code>Cordova iOS 4.5.2</code> has been released!</p> @@ -46,7 +226,7 @@ cordova platform add ios@4.5.2 <li><a href="https://issues.apache.org/jira/browse/CB-13315">CB-13315</a> - (ios) fixed bug building for ios using Xcode 9 (#338)</li> </ul> </description> - <pubDate>Mon, 16 Oct 2017 00:00:00 -0700</pubDate> + <pubDate>Mon, 16 Oct 2017 00:00:00 -0500</pubDate> <link>https://cordova.apache.org/announcements/2017/10/16/ios-release.html</link> <guid isPermaLink="true">https://cordova.apache.org/announcements/2017/10/16/ios-release.html</guid> @@ -189,7 +369,7 @@ cordova platform add ios@4.5.2 <li><a href="https://issues.apache.org/jira/browse/CB-12748">CB-12748</a> Update CI to test node 4 and 6</li> </ul> </description> - <pubDate>Tue, 10 Oct 2017 00:00:00 -0700</pubDate> + <pubDate>Tue, 10 Oct 2017 00:00:00 -0500</pubDate> <link>https://cordova.apache.org/news/2017/10/10/tools-release.html</link> <guid isPermaLink="true">https://cordova.apache.org/news/2017/10/10/tools-release.html</guid> @@ -237,7 +417,7 @@ cordova platform update android@6.3.0 <li><a href="https://issues.apache.org/jira/browse/CB-12617">CB-12617</a> : removed node0.x support for platforms and added engineStrict</li> </ul> </description> - <pubDate>Wed, 27 Sep 2017 00:00:00 -0700</pubDate> + <pubDate>Wed, 27 Sep 2017 00:00:00 -0500</pubDate> <link>https://cordova.apache.org/announcements/2017/09/27/android-release.html</link> <guid isPermaLink="true">https://cordova.apache.org/announcements/2017/09/27/android-release.html</guid> @@ -295,7 +475,7 @@ cordova platform add ios@4.5.1 <li><a href="https://issues.apache.org/jira/browse/CB-12888">CB-12888</a> - cordova emulate <strong>iOS</strong> doesn&#39;t work in <strong>iOS</strong> 11</li> </ul> </description> - <pubDate>Mon, 25 Sep 2017 00:00:00 -0700</pubDate> + <pubDate>Mon, 25 Sep 2017 00:00:00 -0500</pubDate> <link>https://cordova.apache.org/announcements/2017/09/25/ios-release.html</link> <guid isPermaLink="true">https://cordova.apache.org/announcements/2017/09/25/ios-release.html</guid> @@ -385,7 +565,7 @@ cordova plugin add cordova-plugin-camera <li><a href="https://issues.apache.org/jira/browse/CB-12847">CB-12847</a> added <code>bugs</code> entry to <code>package.json</code>.</li> </ul> </description> - <pubDate>Fri, 22 Sep 2017 00:00:00 -0700</pubDate> + <pubDate>Fri, 22 Sep 2017 00:00:00 -0500</pubDate> <link>https://cordova.apache.org/news/2017/09/22/plugins-release.html</link> <guid isPermaLink="true">https://cordova.apache.org/news/2017/09/22/plugins-release.html</guid> @@ -467,7 +647,7 @@ cordova platform add ios@4.5.0 <li>Updated cordova-common to 2.1.0 and other bundled node_modules</li> </ul> </description> - <pubDate>Fri, 08 Sep 2017 00:00:00 -0700</pubDate> + <pubDate>Fri, 08 Sep 2017 00:00:00 -0500</pubDate> <link>https://cordova.apache.org/announcements/2017/09/08/ios-release.html</link> <guid isPermaLink="true">https://cordova.apache.org/announcements/2017/09/08/ios-release.html</guid> @@ -516,7 +696,7 @@ cordova platform add ios@4.5.0 <li><a href="https://issues.apache.org/jira/browse/CB-12766">CB-12766</a> Consistently write <code>JSON</code> with 2 spaces indentation.</li> </ul> </description> - <pubDate>Tue, 05 Sep 2017 00:00:00 -0700</pubDate> + <pubDate>Tue, 05 Sep 2017 00:00:00 -0500</pubDate> <link>https://cordova.apache.org/news/2017/09/05/cordova-common-2.1.0.html</link> <guid isPermaLink="true">https://cordova.apache.org/news/2017/09/05/cordova-common-2.1.0.html</guid> @@ -596,7 +776,7 @@ cordova platform update browser@5.0.0 <li><a href="https://issues.apache.org/jira/browse/CB-11977">CB-11977</a>: updated engines and enginescript for common, fetch, and serve</li> </ul> </description> - <pubDate>Tue, 29 Aug 2017 00:00:00 -0700</pubDate> + <pubDate>Tue, 29 Aug 2017 00:00:00 -0500</pubDate> <link>https://cordova.apache.org/news/2017/08/29/browser-serve-release.html</link> <guid isPermaLink="true">https://cordova.apache.org/news/2017/08/29/browser-serve-release.html</guid> @@ -652,7 +832,7 @@ cordova platform update browser@5.0.0 <li><a href="https://issues.apache.org/jira/browse/CB-12765">CB-12765</a> default app <code>cordova-app-hello-world</code> is now treated like a template</li> </ul> </description> - <pubDate>Fri, 12 May 2017 00:00:00 -0700</pubDate> + <pubDate>Fri, 12 May 2017 00:00:00 -0500</pubDate> <link>https://cordova.apache.org/news/2017/05/12/tools-release.html</link> <guid isPermaLink="true">https://cordova.apache.org/news/2017/05/12/tools-release.html</guid> @@ -662,161 +842,6 @@ cordova platform update browser@5.0.0 <category>news</category> - - </item> - - <item> - <title>Apache Cordova 7.0.0</title> - <description><p>We are happy to announce that <code>Apache Cordova 7.0.0</code> has been released!</p> - -<p>Most notable changes include:</p> - -<ul> -<li><a href="https://www.npmjs.org/package/cordova">cordova@7.0.0</a></li> -<li><a href="https://www.npmjs.org/package/cordova-lib">cordova-lib@7.0.0</a></li> -<li><a href="https://www.npmjs.com/package/plugman">plugman@1.5.0</a></li> -<li><a href="https://www.npmjs.com/package/cordova-app-hello-world">cordova-app-hello-world@3.12.0</a></li> -<li><a href="https://www.npmjs.com/package/cordova-common">cordova-common@2.0.3</a></li> -<li><a href="https://www.npmjs.com/package/cordova-create">cordova-create@1.1.0</a></li> -<li><p><a href="https://www.npmjs.com/package/cordova-fetch">cordova-fetch@1.1.0</a></p></li> -<li><p>If a <code>package.json</code> does not exist in your project, it will be auto-created for you when <code>cordova prepare</code> is called.</p></li> -<li><p>When adding a platform or plugin, the previous default behavior of not-saving has changed to saving. Now it will automatically save that platform or plugin to your <code>config.xml</code> and <code>package.json</code>. Details about platform and plugin versions are also automatically saved in <code>config.xml</code> and <code>package.json</code>. The <code>--save</code> flag is no longer required to save. Use <code>--nosave</code> to prevent saving to <code>config.xml</code> or <code>package.json</code>.</p></li> -<li><p>Fetch is now the default method for fetching platforms. Fetch uses your system <code>npm</code> to <code>npm install</code> modules into your project. The <code>--fetch</code> flag is no longer required. Use the <code>--nofetch</code> flag to revert to pre-<code>Cordova@7.0</code> behavior (<code>npm install</code> is not used to fetch modules).</p></li> -<li><p>After <code>cordova prepare</code> is run, <code>package.json</code> and <code>config.xml</code> should contain identical platforms and versions. In case of conflicts, <code>package.json</code> is given precedence over <code>config.xml</code>. For example, suppose <code>package.json</code> contains <code>cordova-android@6.0.0</code> and <code>config.xml</code> contains <code>cordova-android@4.0.0</code>. After <code>cordova prepare</code> is run, <code>config.xml</code> and <code>package.json</code> will each contain only <code>cordova-android@6.0.0</code>.</p></li> -<li><p>Platforms and plugins are now required to have a <code>package.json</code> file.</p></li> -<li><p>We have added support for custom platforms. This will allow future custom platforms, and modified versions of existing platforms. Example: </p> -<div class="highlight"><pre><code class="language-" data-lang="">cordova platform add custom-platform-name -</code></pre></div></li> -<li><p>A <code>cordova config</code> command has been created to <code>set</code>, <code>get</code>, <code>delete</code>, <code>edit</code>, and <code>list</code> global Cordova options. For example, you can use the following command <code>cordova config set &lt;key&gt; &lt;value&gt;</code> to set the value of <code>autosave</code> or <code>fetch</code> to <code>true</code> or <code>false</code>. </p> - -<p>In the following case, you are turning off <code>autosave</code> as the default setting. <code>autosave</code> is true by default in cordova. Example: </p> -<div class="highlight"><pre><code class="language-" data-lang="">cordova config set autosave false -</code></pre></div> -<p>In the following case, you are turning off <code>fetch</code> as the default setting. <code>fetch</code> is <code>true</code> by default in cordova. Example:</p> -<div class="highlight"><pre><code class="language-" data-lang="">cordova config set fetch false -</code></pre></div> -<p>In addition, the <code>cordova config</code> command supports the <code>browserify</code> setting, which allows the JavaScript of plugins to be loaded at build time compared to run time. For instance, if the <code>browserify</code> value is not explicitly passed in by the user, the <code>cordova config</code> command will automatically set the <code>browserify</code> value saved in <code>~/.config/configstore/</code> to be saved <code>globally</code>. Users can get and set <code>browserify</code>. <code>browserify</code> is <code>false</code> by deafult in cordova. Example:</p> -<div class="highlight"><pre><code class="language-" data-lang="">cordova config get browserify -cordova config set browserify true -</code></pre></div></li> -<li><p>Dropped support for node 0.x. Only node versions 4.0 and up are supported.</p></li> -<li><p>Dropped support for wp8 (windows phone 8).</p></li> -<li><p><code>cordova-windows</code> : dropped support for any versions older than 4.0.0.</p></li> -<li><p><code>cordova-android</code> : dropped support for any versions older than 5.0.0.</p></li> -<li><p><code>cordova-ios</code> : dropped support for any versions older than 4.0.0.</p></li> -<li><p><code>cordova-osx</code> : dropped support for any versions older than 4.0.0.</p></li> -</ul> - -<p>To upgrade:</p> -<div class="highlight"><pre><code class="language-" data-lang="">npm install -g cordova@latest -</code></pre></div> -<p>Please report any issues you find at <a href="http://issues.cordova.io/">issues.cordova.io</a>!</p> - -<!--more--> - -<h1>Changes include:</h1> - -<h2>cordova-lib</h2> - -<ul> -<li><a href="https://issues.apache.org/jira/browse/CB-12747">CB-12747</a>: updated pinned platforms</li> -<li><a href="https://issues.apache.org/jira/browse/CB-12705">CB-12705</a>: Modified <code>(before|after)_plugin_(uninstall|install)</code> to always expect existence of plugin field</li> -<li><a href="https://issues.apache.org/jira/browse/CB-12705">CB-12705</a>: Pass plugin info to project <code>*_plugin_install</code> hooks</li> -<li><a href="https://issues.apache.org/jira/browse/CB-11242">CB-11242</a>: removed support for platforms that don&#39;t have a <code>package.json</code></li> -<li><a href="https://issues.apache.org/jira/browse/CB-11242">CB-11242</a>: updated tests and fixtures</li> -<li><a href="https://issues.apache.org/jira/browse/CB-11242">CB-11242</a>: refactored out <code>getPlatformApiFunction</code></li> -<li><a href="https://issues.apache.org/jira/browse/CB-11242">CB-11242</a>: removed <code>parser</code> and <code>handler</code> files for deprecated versions of platforms</li> -<li><a href="https://issues.apache.org/jira/browse/CB-12683">CB-12683</a>: improved error messaging for when a plugin doesn&#39;t have <code>package.json</code></li> -<li><a href="https://issues.apache.org/jira/browse/CB-12674">CB-12674</a>: Added deprecation notice for <strong>blackberry10</strong> and <strong>ubuntu</strong></li> -<li><a href="https://issues.apache.org/jira/browse/CB-11777">CB-11777</a>: Restore plugins before preparing</li> -<li><a href="https://issues.apache.org/jira/browse/CB-12643">CB-12643</a>: removed references to <strong>wp8</strong></li> -<li><a href="https://issues.apache.org/jira/browse/CB-12645">CB-12645</a>: removed references to <strong>firefoxos</strong></li> -<li><a href="https://issues.apache.org/jira/browse/CB-12665">CB-12665</a>: removed <code>engineStrict</code> as it is no longer supported</li> -<li><a href="https://issues.apache.org/jira/browse/CB-12612">CB-12612</a>: removing old <code>amazon-fireos</code> code</li> -<li><a href="https://issues.apache.org/jira/browse/CB-12425">CB-12425</a>: autocreate a <code>package.json</code> if it doesn&#39;t exist during <code>cordova prepare</code> </li> -<li><a href="https://issues.apache.org/jira/browse/CB-12517">CB-12517</a>: <code>package.json</code> <code>name</code> field is <code>config.xml</code> <code>id</code> field and <code>package.json</code> <code>displayName</code> field is <code>config.xml</code> <code>name</code> field</li> -<li><a href="https://issues.apache.org/jira/browse/CB-12592">CB-12592</a>: added <code>requireNoCache</code> function and replaced instances of <code>delete.require cache</code></li> -<li><a href="https://issues.apache.org/jira/browse/CB-12606">CB-12606</a>: Fix plugin dependency installation. Now it respects the <code>spec</code> specified for dependencies of plugins in <code>plugin.xml</code></li> -<li><a href="https://issues.apache.org/jira/browse/CB-12016">CB-12016</a>: removed <code>pluginMapper</code> code from uninstall</li> -<li><a href="https://issues.apache.org/jira/browse/CB-12337">CB-12337</a>: Resolve symbolic links in project root</li> -<li><a href="https://issues.apache.org/jira/browse/CB-11346">CB-11346</a>: Remove known platforms check</li> -<li><a href="https://issues.apache.org/jira/browse/CB-11977">CB-11977</a>: removed support for <code>node 0.x</code></li> -<li><a href="https://issues.apache.org/jira/browse/CB-12021">CB-12021</a>: Added local path support to <code>--fetch</code> and fixed failing tests for adding a relative path</li> -<li><a href="https://issues.apache.org/jira/browse/CB-11960">CB-11960</a>: Added support to <code>package.json</code> for platform/plugin add/rm</li> -<li><a href="https://issues.apache.org/jira/browse/CB-12001">CB-12001</a>: Added support for platform/plugin &amp; <code>spec</code> restore to sync <code>config.xml</code> and <code>package.json</code></li> -</ul> - -<h2>cordova-cli</h2> - -<ul> -<li><a href="https://issues.apache.org/jira/browse/CB-12570">CB-12570</a>: <code>cordova-fetch</code> is true by default. Use <code>--nofetch</code> flag to fetch platforms and plugins using old fetching logic.</li> -<li><a href="https://issues.apache.org/jira/browse/CB-12665">CB-12665</a>: removed <code>engineStrict</code> as it is no longer supported</li> -<li><a href="https://issues.apache.org/jira/browse/CB-11982">CB-11982</a>: added <code>edit</code> and <code>ls</code> to <code>cordova config</code></li> -<li><a href="https://issues.apache.org/jira/browse/CB-11982">CB-11982</a>: added new <code>cordova config</code> command that <code>sets</code>, <code>gets</code>, and <code>deletes</code> global environment variables.</li> -<li><a href="https://issues.apache.org/jira/browse/CB-12008">CB-12008</a>: updated docs to reflect new autosave changes and removed variables missed due to rebase</li> -<li><a href="https://issues.apache.org/jira/browse/CB-12008">CB-12008</a>: made autosave the default for platform and plugin add/remove</li> -<li><a href="https://issues.apache.org/jira/browse/CB-11977">CB-11977</a>: removed support for <code>node 0.x</code></li> -</ul> - -<h2>cordova-fetch</h2> - -<ul> -<li><a href="https://issues.apache.org/jira/browse/CB-12665">CB-12665</a>: removed <code>enginestrict</code> since it is deprecated</li> -<li>added support for dealing with local path targets</li> -</ul> - -<h2>cordova-common</h2> - -<ul> -<li><a href="https://issues.apache.org/jira/browse/CB-8978">CB-8978</a>: Add option to get <code>resource-file</code> from <code>root</code></li> -<li><a href="https://issues.apache.org/jira/browse/CB-11908">CB-11908</a>: Add tests for <code>edit-config</code> in <code>config.xml</code></li> -<li><a href="https://issues.apache.org/jira/browse/CB-12665">CB-12665</a>: removed <code>enginestrict</code> since it is deprecated</li> -</ul> - -<h2>plugman</h2> - -<ul> -<li><a href="https://issues.apache.org/jira/browse/CB-12747">CB-12747</a>: Updated <code>cordova-lib</code> dependency to <code>7.0.0</code></li> -</ul> - -<h2>cordova-create</h2> - -<ul> -<li><a href="https://issues.apache.org/jira/browse/CB-10681">CB-10681</a>: templates will add <code>@latest</code> when fetching from npm when no version is specified. This will ensure an older cached version of the template is not used</li> -<li><a href="https://issues.apache.org/jira/browse/CB-12666">CB-12666</a>: Remove <code>node 0.x</code> support.</li> -<li><a href="https://issues.apache.org/jira/browse/CB-12517">CB-12517</a>: <code>package.json</code> <code>displayname</code> should equal <code>config.xml</code> name field and <code>package.json</code> <code>name</code> field should equal <code>config.xml</code> <code>id</code> field.</li> -</ul> - -<h2>cordova-app-hello-world</h2> - -<ul> -<li><a href="https://issues.apache.org/jira/browse/CB-12684">CB-12684</a>: added <code>package.json</code> to default hello world app</li> -<li>Add GitHub pull request template</li> -</ul> - -<h2>Pinned Platform Versions for <strong>Cordova CLI 7.0.0</strong></h2> - -<ul> -<li>Cordova Android: ~6.2.2</li> -<li>Cordova BlackBerry10: ~3.8.0</li> -<li>Cordova Browser: ~4.1.0</li> -<li>Cordova iOS: ~4.4.0</li> -<li>Cordova OSX: ~4.0.1</li> -<li>Cordova Ubuntu: ~4.3.4</li> -<li>Cordova Windows: ~5.0.0</li> -<li>Cordova WebOS: ~3.7.0</li> -</ul> -</description> - <pubDate>Thu, 04 May 2017 00:00:00 -0700</pubDate> - <link>https://cordova.apache.org/news/2017/05/04/cordova-7.html</link> - <guid isPermaLink="true">https://cordova.apache.org/news/2017/05/04/cordova-7.html</guid> - - <category>news</category> - - <category>releases</category> - - - <category>news</category> </item> --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org