Ionic Storage caching images not Working in IOS

#1

I am Storing a JSON object in ionic storage and I am using this storage to work in offline mode.
JSON object is also carrying some links which are referring to some images

In android when I run the app in offline mode it is getting the images from the storage.
But in IOS it is getting all data except images.

Can you tell me why in android it is working fine and in IOS it is not ?

Native storage stores JSON object, I have tested.
Native storage is also not getting images in IOS in offline mode.

Difference between Native Storage and Ionic Storage?
#2

Is it getting the URLs of these images or the actual images from storage?

Can you share one of the objects you store, so we can see its structure?

#3

It is getting the url.

#4

Then this has nothing to do with Storage at all, but is just normal image caching behaviour of your app.

Can you replicate the same behaviour if you just hardcode the URL in your template (instead of getting it from storage) and view it offline?

#5

In android a url is cached without enabling a single thing but this thing does not work in iOS.

In android if you hit a url in online mode it will get the image and in offline mode it will fetch the image from the cache.

But in iOS I think so cache does not work
How to perform image caching in iOS ?

#6

If you don’t get any better answers, you can consider using data URLs. They’re less efficient in terms of storage space, but are considerably easier to work with in situations like this.

#7

If this is really the case in iOS, you will have to handle caching yourself somehow. I suggest creating a new topic, where you just describe the problem (How to make iOS app cache external images…) and ask for solutions. (Not related to Ionic Storage in any way, so this topic won’t be the right place to discuss this)

#8

Hi, i have this problem also, find a solution ?