1

I thought I had my problem solved when I saw this SO answer

Issue with Android Hybid app to display remote image with Ionic framework?

This works in development and I deployed this APK to the store as my app was effectively broken and when it's downloaded from the Play store it doesn't work. No images from external URLs are down.

I have done in Config.xml:

<access origin="*"/>

<allow-navigation href="http://*/*" />

and the following in index.html

<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">

Additionally it would be great to know how to simulate this is testing as if this was to happen with the Apple App Store we would be in trouble.

==EDIT==

So I have pinned this down to the release APK. The debug works perfectly however when I install the release APK manually then I am unable to view the images from external sources. Obviously I am unable to debug this version either?

Community
  • 1
  • 1
Taylorsuk
  • 1,419
  • 1
  • 16
  • 51

2 Answers2

0

have you install the cordova whitelist plugin ? See my explanation here : https://stackoverflow.com/a/30135532/3687474

Or install the de version : cordova plugin add https://github.com/apache/cordova-plugin-whitelist

Community
  • 1
  • 1
aorfevre
  • 5,034
  • 3
  • 21
  • 51
  • Yes i'm pretty certain - just tried it again using `cordova plugin add cordova-plugin-whitelist` and i'm getting a `404` I wonder if thats what happened before and I thought I had added it... – Taylorsuk May 17 '15 at 14:33
  • `Failed to find the bower component "cordova-plugin-whitelist".` – Taylorsuk May 17 '15 at 14:34
  • this is strange, I do hve it installed properly => cordova-plugin-whitelist Try to install the dev version (see my post) – aorfevre May 17 '15 at 14:36
  • I have added command to install the dev version of whitelist plugin – aorfevre May 17 '15 at 14:37
  • `npm ERR! addLocal Could not install github.com/apache/cordova-plugin-whitelist Error: ENOENT, stat 'github.com/apache/cordova-plugin-whitelist' ` – Taylorsuk May 17 '15 at 14:38
  • this command is not correct, Stackoverflow automaticly hide "https://" see my post edited , I paste it with the https:// – aorfevre May 17 '15 at 14:39
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/78023/discussion-between-taylorsuk-and-aorfevre). – Taylorsuk May 17 '15 at 14:47
0

I had to run:

npm install -g cordova

then run ionic platform remove android followed by adding it again and then adding the whitelist plugin as described above:

ionic plugin add https://github.com/apache/cordova-plugin-whitelist.git

Taylorsuk
  • 1,419
  • 1
  • 16
  • 51