if I could add my assets folder into the documents directory that would be perfect but I don't think that is possible? I maybe wrong and if anyone has any suggestions that would be great also.
thanks
phil
no, the documents directory doesn't exist until the app is installed - it's basically like apps on the windows desktop that make their own subdirectories inside My Documents. All the directories in your IPA, including assets, live in the application directory after installation, kind of like an app's install directory in Program Files on the windows desktop.
There is a static File.applicationDirectory property on the File class, it points to the application directory, but it also notes the following:
|
Modifying content in the application directory is a bad practice, for security reasons, and is blocked by the operating system on some platforms.
|
I would manually build the shipping assets in the Assets directory before building the IPA, and then when your application downloads new content from the server, put it in the cache directory (available through <code>File.cacheDirectory</code>.
When you load content and there's no network, first check in the cache directory, if the file is not then load from the Assets directory. Yes, you're storing two copies but there's really no other choice on iOS.