zyra / ionic-image-loader

Ionic 2+ Component that loads images in a background thread and caches them for later use
MIT License
435 stars 137 forks source link

Working in browser and ionic lab, not working on device android and ios #241

Closed pierresh closed 5 years ago

pierresh commented 5 years ago

Hello,

Thanks a lot for this plugin that sounds awesome. I succeeded to make it working within my app on browser and with ionic lab, but not on mobile, both on Android and iOS. The picture is never displayed and the spinner keeps rotating. I tried to enable the debug mode but I cannot see any log with adb logcat or in Xcode's console.. Could anyone let me know what I could do to investigate where is the problem? Thanks!

Here is below my ionic info

Ionic:

   ionic (Ionic CLI)  : 4.9.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.3

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4, browser 5.0.3, ios 4.5.5, windows 6.0.1
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 1.2.1, (and 23 other plugins)

System:

   Android SDK Tools : 25.2.5 (/usr/local/Cellar/android-sdk/24.1.2/)
   ios-deploy        : 1.9.2
   NodeJS            : v10.15.3 (/usr/local/bin/node)
   npm               : 6.4.1
   OS                : macOS Mojave
   Xcode             : Xcode 10.1 Build version 10B61
yunusunsal commented 5 years ago

I think,I have same problem. But that works on my login page and not working other page in my project. I don't understand. Same Code. Same Use. But Not Same Working :(

pierresh commented 5 years ago

Thanks a lot for your feedback. I also added that component on my login page. After several tests, it works on both Android / iOS on the login page if I start the app with wifi disabled (my local development server can be reached only through wifi) and then enable wifi: the pictures can be seen quickly after the mobile device is effectively connected with my wifi.

Remark: this does not work if I start my app with wifi activated, then switched off and then re-activated. Very strange problem ^^

akildemir commented 5 years ago

@yunusunsal I have the same problem. It works on 1 page and doesn't work in another one. @pierresh how did you solve it? I do download images myself and cache them myself, I just need this plugin to tell the ionic wait while I am downloading the image and show it when download complete. It worked when I tried first time and never did again. LOl.

pierresh commented 5 years ago

Actually I haven't found any solution yet, I am waiting some feedback from here.

akildemir commented 5 years ago

@pierresh I gave up using this plugin. I did it in another way and it is working. I did something similar to this: https://stackoverflow.com/questions/46487001/how-to-show-a-placeholder-image-before-the-actual-image-loads-in-an-ionic-2-or-3?noredirect=1&lq=1

And instead of using place holder i am using ionic spinner.

emilio-ferrer commented 5 years ago

hello @pierresh I had the same problem, but I downgrade the plugin to version 6.3.2 and this is fine. npm i --save ionic-image-loader@6.3.2

yunusunsal commented 5 years ago

@eferrert I will try. I share the result with you. Thanks.

pierresh commented 5 years ago

@eferrert Yes, I confirm it works with 6.3.2, and this even solve the issue #215 , thanks! Version 6.3.3 seems not stable.

tinnocente commented 5 years ago

Does this work with Ionic 4?

jeddsaliba commented 5 years ago

if you're using ionic-image-loader@beta for Ionic 4, add these lines to .htaccess:

IfModule mod_headers.c FilesMatch ".(gif|jpg|jpeg|png)$" Header set Access-Control-Allow-Origin "*" FilesMatch IfModule

cjchrist777 commented 5 years ago

Thanks! it works in version 6.3.2