i've got an app that uses
Titanium.App.Properties to save JSON data.
I'm using this as an easy database. and it's working well.
My problem is, that my app just got rejected because of iCloud backups the .plist of which Titanium.App.Properties uses to store the data (which is ~2MB).
I want to overcome this issue and resubmit my app. Can I just use:
var dir = Ti.Filesystem.applicationDataDirectory +"../Library/Preferences/"; dir.setRemoteBackup = false;and that will couse the .plist file (well, the whole directory) to not get included in iCloud backup process ? if so, should I set that flag on every app run (at the start), or just one time at initial run will do?
if this solution will work i'll prefer using it. otherwise I will change my data storage way
any help ?
I know it's not the answer you're looking for, but putting > 2MB of data in Ti.App.Properties is just not a good idea. It's meant for holding on to things like session data and whatnot. I'd go ahead and switch to other data storage.
Since you're probably fond of JSON, check out these modules:
Ok guys a little update: This is what I've done in order to make a clean fix for my issues:
at initial app launch I have a data.json file in my resources folder. which is the main database for my app. after loaded, I'm creating database files in the Library/Cashes folder, and using them as my databases. Im updating new information and rewriting those files every app launch. Im reading & writing to those files throughout the app.
In order to read\write efficiently, I've attached Ti.App my own readData \ writeData functions which I can use at every given time in my application.
Think you can help? Login to answer this question!