开发者

Releasing IOS app with files in Library directory

开发者 https://www.devze.com 2023-02-13 12:02 出处:网络
I have an app that is going to display a list of local video files. The app will only have a couple of video files at first, but that number will grow with future updates and in-app purchases. I would

I have an app that is going to display a list of local video files. The app will only have a couple of video files at first, but that number will grow with future updates and in-app purchases. I would like to store all these videos in 1 place and it makes sense to put them in the app's Library directory so they are not user-accessible. Is it possible to publish an app with files already in the app's Library directory? Or do I have to put them in the app's bund开发者_开发问答le and then copy them to the Library directory when the app is first launched? Although that would result in the 2 videos files being duplicated since I can't remove them from the bundle.


Yes, you do need to copy the files from the app bundle into the Library if you want to treat all the videos in the same way. You cannot change the contents of the app bundle from inside your app and the only files your app has when it first launches are those that are in the app bundle.

If you really wanted (and if the video files don't change), you could make special cases in your code to be able to get the starting videos from the app bundle and the in-app purchase downloaded videos from the Library directory. But, unless the video files are quite large this seems a bit excessive.

A third option would be to have the user download the starter files on first app launch, but that may be suboptimal for other reasons.


Please look at my answer in this thread. It might concern you or at least be interesting to read.

Does updating iOS apps delete library directory files?

0

精彩评论

暂无评论...
验证码 换一张
取 消