<?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></description>
  <link>https://blog.asgaard.co.uk/2016/10/30/enabling-internet-permissions-in-a-cordova-ionic-app</link>
  <lastBuildDate>Thu, 23 Apr 26 03:52:29 +0000</lastBuildDate>
  <language>en</language>
  <count>1</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>
  </channel>
</rss>