I have an app for iOS that uses Filesharing to provide the user with a couple of downloaded files. This works great, but there are a couple of files that I don't want the user to have access to.
Can I provide a custom folder where iTunes can get the data from or what can I do to prevent these files from being accessed?
You can put the files you want to exclude from filesharing either in (a subfolder in) Library or Caches Folder. Library will be backuped with iTunes, Caches not.
From Sharing Files with the User section from docs:
Important: In iTunes, users can manipulate only the top-level items in the Documents directory. Users cannot see the contents of subdirectories but can delete those directories or copy their contents to the desktop. Take this into consideration when deciding where to put files in this directory.
So with File sharing enabled you cannot hide files in Documents folder - you rather should put it in another folder in application sandbox:
If you do not want files to be shared with the user, put them in your application’s Library directory. If none of the standard Library subdirectories are appropriate, create a private directory inside the Library directory and give it the name of your application’s bundle ID. You can then use that directory to store any files that are private to your application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With