get path to <Application_Home>/Library/Caches on iOS
Hi,
since the iOS data storage guidelines indicate that all data that can be regenerated should be stored in <Application_Home>/Library/Caches, what is the Titanium way to recieve that path reliable for all iOS versions?
in Titanium.API.Filesystem I could not find a related constant.
15 Answers
-
While waiting for a solution…
exports.cacheDirectory = Titanium.Filesystem.applicationDataDirectory + "../Library/Caches/";
This works on simulator and device and isn't rocket science :)
This is what where using for now. (we have an app submitted, not approved yet) -
This seems not to give the right path. I do:
var f = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,filename); f.write(this.responseData);
Using the iPhone Simulator the fle is placed in
Library/Application Support/iPhone Simulator/4.3.2/Applications/XXXAPPID/Documents/
but it should be inLibrary/Application Support/iPhone Simulator/4.3.2/Applications/XXXAPPID/Library/Caches
-
Ok guys, you must use version 1.7.3 or greater of the mobile sdk to use iOS5.
-
We're having the same issue here, our app just got rejected for this reason. Any help would be appreciated :)
-
It seems like there is a new flag in
Ti.Filesystem.File
calledremoteBackup
. Simply set that always to false and your files are still in the documents directory but not backed up via iCloud.
BUT: Note that this actually prevents ALL backups, not just to iCloud. -
The constant
applicationDataDirectory
within the Filesystem API automatically targets this location for you. You can target a file within that directly like so:Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, 'file.txt');
-
Same problem. I have a large read only database in my app that I install the db with Titanium.Database.install. Titanium placed the database in:
Library/Application Support/database
Since iOS 5 and iCloud integration the database should be placed in:
Library/Caches
I got an email from Apple that I have to change this in my app but I can't set the path where Titanium installs the database.
Any ideas?
-
This seems to one of the only threads that is trying to deal with the problems caused by iOS 5 and iCloud updates. My app was just rejected from the app store due to violating these new data storage policies; I have been able to move all the downloaded data and databases to the Caches folder as described above but now I risk having all this data deleted if the device is low in storage space. Apple says that we should create a new private folder and set the "do not back up" attribute (http://developer.apple.com/library/ios/#qa/qa1719/_index.html). Has anyone figured out how to do this via Titanium?
-
There is a Jira issue for this problem located here:
http://jira.appcelerator.org/browse/TIMOB-6273
Let's hope they come up with a work around. -
I also have this problem , my app has been rejected for the same reasons..
All my apps are concerned. This is really a big problem.
Hope a workaround rapidly.
Thanks.
-
According to the JIRA issue TIMOB-6286, they think this is a trivial issue; I argued the priority up to "medium" but they still have it scheduled for the 1.9.0 release. Please add a comment to this issue complaining about this; I can't believe they don't see how big a big problem this is.
-
According to the JIRA issue TIMOB-6286, they think this is a trivial issue; I argued the priority up to "medium" but they still have it scheduled for the 1.9.0 release. Please add a comment to this issue complaining about this; I can't believe they don't see how big a big problem this is.
-
We also need the cache folder for our upcoming release. Apple will not approve it currently, since we put all cached data in the documents folder.
-
Our app got approved! All in Titanium.Filesystem.applicationDataDirectory + "../Library/Caches/";
-
Is data safe in this location Titanium.Filesystem.applicationDataDirectory + "../Library/Caches/" for say 100s of MB of information? Is there a risk of that data being deleted automatically in some form of cache purge?