Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a Directory under Library/Caches in PhoneGap iOS Application

I can put my data in directory of Documents folder of App, but it has been rejected from Apple for reason of not follow the iOS Data Storage Guidelines.

Trying to figure out how to create a directory under Library/Cache in iOS on the file system using PhoneGap.

I want to create a directory for my PhoneGap application, so I can store images and JSON data user synced from server.

like image 818
Wen Avatar asked Feb 01 '26 20:02

Wen


1 Answers

When I use window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess, onError);, it save my file to Documents folder under my App, so I got Apple rejected. The reason is the system backup all data under Documents folder to iCould after iOS6, so Apple does not allow big data like images or JSON file which could sync from your server again to keep in this folder.

So I use LocalFileSystem.TEMPORARY instead. It does not save the data to Library/Cache, but it save data to temp folder of App, which does not been auto backup to iCloud and not auto deleted either. Finally, my application has been passed Apple review.

like image 112
Wen Avatar answered Feb 03 '26 21:02

Wen