<?xml version="1.0" encoding="UTF-8"?> 
<rss version="2.0"
        xmlns:content="http://purl.org/rss/1.0/modules/content/"
        xmlns:wfw="http://wellformedweb.org/CommentAPI/"
        xmlns:dc="http://purl.org/dc/elements/1.1/"
        xmlns:atom="http://www.w3.org/2005/Atom"
        xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
        xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
        >
<channel>
  <title>asgaard</title>
  <description>Phonegap</description>
  <link>https://blog.asgaard.co.uk/t/phonegap</link>
  <lastBuildDate>Thu, 23 Apr 26 05:26:34 +0000</lastBuildDate>
  <language>en</language>
  <count>2</count>
  <offset>0</offset>
      <item>
    <title>Enabling internet permissions in a Cordova/Ionic app</title>
    <link>https://blog.asgaard.co.uk/2016/10/30/enabling-internet-permissions-in-a-cordova-ionic-app</link>
    <pubDate>Sun, 30 Oct 16 20:34:42 +0000</pubDate>
    <guid>https://blog.asgaard.co.uk/2016/10/30/enabling-internet-permissions-in-a-cordova-ionic-app</guid>
    <description><![CDATA[
<p>
If you try running a Cordova/Ionic app with few plugins, you&#039;ll probably be very confused when you try to create an HTTP request. It&#039;ll work fine in the browser, but on a device it&#039;ll fail.
<p>
If you hook it up to the Chrome developer tools and inspect the webview, it&#039;ll show Status: (failed) and Type: Pending.
<p>
<img src='/assets/img/2016-10-30/cordova-failed-pending.png' class='width-100' alt=''/>
<p>
The answer to this is that you need to ask for access to network permissions.<div class='width-100 clear-fix'>
<p>
<img src='/assets/img/2016-10-30/Screenshot_20161030-122213.png' class='width-40 float-left' title='How your permissions might look' alt='How your permissions might look'/><img src='/assets/img/2016-10-30/Screenshot_20161030-122315.png' class='width-40 float-right' title='How your permissions should look' alt='How your permissions should look'/>
<p>
</div>
<p>
It seems like you should be able to define your app&#039;s permissions in the config.xml file, but this doesn&#039;t seem to be the case. However, plugins can declare permissions in their plugin.xml file.
<p>
So, I created a <a href='https://github.com/markwatkinson/cordova-plugin-internet-permissions'>plugin which does nothing else than defines a plugin.xml which asks for network permissions</a>.
<p>
To install it, use: 
<p>
<code>cordova plugin add https://github.com/markwatkinson/cordova-plugin-internet-permissions.git</code>
<p>
[...]]]></description>
    <content:encoded><![CDATA[
<p>
If you try running a Cordova/Ionic app with few plugins, you&#039;ll probably be very confused when you try to create an HTTP request. It&#039;ll work fine in the browser, but on a device it&#039;ll fail.
<p>
If you hook it up to the Chrome developer tools and inspect the webview, it&#039;ll show Status: (failed) and Type: Pending.
<p>
<img src='/assets/img/2016-10-30/cordova-failed-pending.png' class='width-100' alt=''/>
<p>
The answer to this is that you need to ask for access to network permissions.<div class='width-100 clear-fix'>
<p>
<img src='/assets/img/2016-10-30/Screenshot_20161030-122213.png' class='width-40 float-left' title='How your permissions might look' alt='How your permissions might look'/><img src='/assets/img/2016-10-30/Screenshot_20161030-122315.png' class='width-40 float-right' title='How your permissions should look' alt='How your permissions should look'/>
<p>
</div>
<p>
It seems like you should be able to define your app&#039;s permissions in the config.xml file, but this doesn&#039;t seem to be the case. However, plugins can declare permissions in their plugin.xml file.
<p>
So, I created a <a href='https://github.com/markwatkinson/cordova-plugin-internet-permissions'>plugin which does nothing else than defines a plugin.xml which asks for network permissions</a>.
<p>
To install it, use: 
<p>
<code>cordova plugin add https://github.com/markwatkinson/cordova-plugin-internet-permissions.git</code>
<p>
]]></content:encoded>
  </item>
      <item>
    <title>Your APK&#039;s version code needs to be higher than 100008.</title>
    <link>https://blog.asgaard.co.uk/2016/10/15/your-apk-s-version-code-needs-to-be-higher-than-100008</link>
    <pubDate>Sat, 15 Oct 16 18:59:40 +0000</pubDate>
    <guid>https://blog.asgaard.co.uk/2016/10/15/your-apk-s-version-code-needs-to-be-higher-than-100008</guid>
    <description><![CDATA[
<p>
When trying to upload my <a href='//solvercs.asgaard.co.uk'>Android app Crossword Solver CS</a> to the Play store, I have been encountering the error:
<p>
<pre>Your APK's version code needs to be higher than 100008.</pre>
<p>
The app is an Ionic/Cordova app and Cordova handles creating that version code.
<p>
The 8 on the end makes little sense because the version I had there already was v1.0.0. I checked through git and my config.xml always had the version as v1.0.0.
<p>
<a href='https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#setting-the-version-code'>Cordova claims</a> that the version code will be generated automatically from the string and will be equal to: versionCode = MAJOR * 10000 + MINOR * 100 + PATCH.
<p>
For some reason it has followed this formula, then concatenated an &#039;8&#039; on the end making the end result an order of magnitude too big.
<p>
As far as I can tell this has come about because I used a Linux VM to generate the initial release and a different machine to generate the update. The latter has a newer version of Ionic/Cordova, which presumably does not have the &#039;8&#039; bug.
<p>
How do you fix this? Well, you need to bump up one o[...]]]></description>
    <content:encoded><![CDATA[
<p>
When trying to upload my <a href='//solvercs.asgaard.co.uk'>Android app Crossword Solver CS</a> to the Play store, I have been encountering the error:
<p>
<pre>Your APK's version code needs to be higher than 100008.</pre>
<p>
The app is an Ionic/Cordova app and Cordova handles creating that version code.
<p>
The 8 on the end makes little sense because the version I had there already was v1.0.0. I checked through git and my config.xml always had the version as v1.0.0.
<p>
<a href='https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#setting-the-version-code'>Cordova claims</a> that the version code will be generated automatically from the string and will be equal to: versionCode = MAJOR * 10000 + MINOR * 100 + PATCH.
<p>
For some reason it has followed this formula, then concatenated an &#039;8&#039; on the end making the end result an order of magnitude too big.
<p>
As far as I can tell this has come about because I used a Linux VM to generate the initial release and a different machine to generate the update. The latter has a newer version of Ionic/Cordova, which presumably does not have the &#039;8&#039; bug.
<p>
How do you fix this? Well, you need to bump up one of the components to multiply your end result by 10 and offset it by 8.
<p>
So I have gone from v1.0.0 to v10.0.9, which seems a bit ridiculous.]]></content:encoded>
  </item>
  </channel>
</rss>