Where to Store purchased very huge files >200MB on iOS? - ios

Where i have to store downloaded huge files on iOS?
the file is more then 200MB.
Is < Application_Home >/Library/Caches the right directory for it?
The file is downloaded after in app purchase and should remain in the App.

After iCloud is implemented in Apple, The Document directory data is somehow related with iCloud Storage. Hence Apple is now rejecting the applications using heavy data storage in document directory.
You need to store the data at some other location. Store the PDF & Other Artwork file At some other location.
This link May Help You.
https://developer.apple.com/icloud/documentation/data-storage/
I Hope this helps.

Related

Download files from url and save to iCloud (Folder app in iOS 11)?

I have some file links in url and I just want to give user a option to save those files directly to his/her iCloud storage or the latest Files App in iOS 11.I have not came through any such link which helps me out in this regard. Some links are creating a zip file after downloading as NSData and syncing to iCloud. I want to give a feature like WhatsApp to save directly the file withe the same extension to iCloud.

Can a PDF downloaded by my iOS app be viewed by iBooks or any other application?

Right now, the PDFs I download on my app are being stored in the app's document directory and can be retrieved only within the app. Is there any way to store the PDF files in the common documents directory that can be accessed by other apps?
If not, is there a way of storing my downloaded PDFs in other apps' documents directory (let's say iBooks), so that it will always be stored in iBooks.
If there are any ways, please elaborate.
There is no "commun documents directory" on iOS, each App is launched in is own sandbox and cannot access the files from other app directly.
I suggest you to check the iOS File System Basics guide from Apple in order to understand better what's happening behind the scenes.
You can still use an UIActivityController in your code to perform an export of your pdf file to iBooks or any app accepting this kind of file, but it requires some user interaction.

Which is permanent storage directory in iOS?

I need to store permanently (as far as app is not uninstalled from the device), the photos that are taken from camera roll and photo library into my app's bundle. Perviously i was storing those file in tmp folder, i read that the contents of tmp folder will be purged by iOS if it finds less memory for other app to run.. so my images were not getting displayed in my app after 3 or 4 days as IOS would have purged the content of tmp folder.
SO where do i need to Store these files? In Documents folder? is documents folder is permanent ?people say that you should not store huge amount of files in documents folder.. There is no limit for the photos that can be taken from my app. user may take 100 photos, 200photos, 500photos, or more than that.. its ok if user uninstall the application.. i will download all those photos in background once he login again. so what would you suggest for this problem? any kind of help is highly appreciated.
thanks
You put the files in the Documents folder, or if you can download them again from Internet, in the cache folder. If in Documents folder, you must mark the files with the attribute that prevents them from getting backed up to iCloud, or your app will be rejected.
Do that using this documentation:
https://developer.apple.com/library/ios/qa/qa1719/_index.html
These rules are enforced pretty vigorously by Apple and spelled out in:
https://developer.apple.com/icloud/documentation/data-storage/
(Requires iOS app developer login to view, I believe.)
What you are looking for here is SQLite. Using SQLite you can store your data and Images.
For storing the Images you can refer this link

Should I follow iOS Data Storage Guidelines?

My iOS app is intended to be compatible with iOS 5.0 and above, and it has iCloud capabilities turned off in it's target settings, I'm not integrating with iCloud. My app stores an sqlite file and some image files into Documents folder. The sqlite file is not downloadable, but images are.
I've read some posts from people saying that their app's submission was rejected because they don't met the iOS Data Storage Guidelines, but I'm not sure if that is only required if your app has iCloud capabilities enabled, is it? Should I set the NSURLIsExcludedFromBackupKey for my files anyway?
Thanks in advance
EDIT
I've read this here:
It is not possible to exclude data from backups on iOS 5.0. If your app must support iOS 5.0, then you will need to store your app data in Caches to avoid that data being backed up. iOS will delete your files from the Caches directory when necessary, so your app will need to degrade gracefully if it's data files are deleted.
But I need the sqlite file to be in Documents to insert data... how should I handle this?
It has nothing at all to do with whether your app uses iCloud or not. It has to do with the user performing backups to iCloud which is beyond the control of your app.
If all of the data in your app that is stored in the app sandbox is data that is created and stored by the user through the use of the app then Apple will have no problem with the data being backed up.
They have issue with replaceable files being backed up needlessly. If the database file is read-only and could be obtained from a server or the app bundle then don't let it be backed up. But if it starts out mostly empty and then gets data added as the user adds data through the app then it should be backed up. Same for the images.

IOS - In-app purchase downloadable media storage guidelines

I have an app which has in app purchase downloadable videos. The first time I submitted to the app store it was rejected because I was writing it to <Application_Home>/Documents directory. The rejected reason stated that
In particular, we found that on launch and/or content download, your
app stores 20MB.
I read the guideline and it told me that
Data that can be downloaded again or regenerated should be stored in
the <Application_Home>/Library/Caches directory. Examples of files you
should put in the Caches directory include database cache files and
downloadable content, such as that used by magazine, newspaper, and
map applications.
I checked the simulator's cache directory and found that there is a default folder within the Caches folder with the name of the Bundle Id of the app. So I changed it to the following path
<Application_Home>/Library/Caches/<Bundle ID>/
Ran this in the sim and seems fine. However, when I uploaded it, it was rejected. The problem seems to come from writing the data.
Question: Is there something wrong with this directory? Should I just store it in the Caches root folder?
Thanks.

Resources