4 Replies Latest reply on Jan 8, 2018 8:07 AM by jcesarmobile_

    External images not displaying in app release

    gabrielet41163941

      Hello everyone,
      I'm new to phonegap build development and I'm really struggling with this problem as I can't find any answers over the internet (stunning to me).

       

      I usually debug my app using the phonegap app on my phone and use phonegap Build to release the .apk and try all my changes on the actual app installed on my device. I have to show dynamic images in the app (kind of like Instagram) coming from a server online.

       

      1) Which is the best way to retrieve images from an online server using phonegap? Get the external links only and load the resources through <img src="http://www.domain.com/etc" />, or get the images themselves from the server with some cordova plugin?

       

      2) Using external URL for my images, they work fine while in the phonegap app for debugging, but once I build my release on PGB all my external images fail to load, unless they are already in cache of course. I set <access origin="*" /> on my config file and use one of the least strict security policy ( <meta http-equiv="Content-Security-Policy" content="default-src *; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'; media-src *; img-src * filesystem: data:"> ). Could someone please tell me why external images are not working on the released app from phonegap build?

       

      Thanks for your time, have a great day.

       

      Gabriele