远程更新iOS资源文件
我在 App Store 上有一个应用程序,需要定期(每 2-3 个月)更新其资源数据文件。到目前为止,每次我需要这样做时,我都会将应用程序的新版本部署到应用程序商店,但事实上我必须等待一两周才能使更改生效,这很麻烦。
理论上,我正在考虑创建一个新的“version_control.txt”资源文件,该文件跟踪每个其他资源文件的版本号。该应用程序会定期检查其 version_control.txt 与某个 Web 服务器上的版本,然后下载需要更新的任何文件。
是否有任何框架或 SDK 可以为我处理所有这些,或者我必须自己编写所有内容?有更好的解决方案吗?
I have an app on the App Store that needs to have its resource data files updated periodically (every 2-3 months). So far, I've just been deploying a new version of the app to the App Store every time I need to do this, but the fact that I have to wait a week or two for the changes to become live is cumbersome.
Theoretically, I was thinking of creating a new "version_control.txt" resource file which tracks the version numbers of every other resource file. Periodically, the app would check its version_control.txt against a version up on some web server, and then download any files that need to be updated.
Do there exist any frameworks or SDKs to handle all of this for me, or do I have to write everything myself? Is there a better solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果不更新整个应用程序,您就无法更新应用程序包中的资源。但是,让您的应用程序从 Web 服务器检索资源并将其保存在应用程序的 Documents 文件夹中是没有问题的。从那里,让应用程序在查看自己的包之前在文档文件夹中查找其资源非常简单。
我不知道有任何框架可以为您管理资源版本。涉及的工作并不多,而且每个应用程序可能都有自己的要求,所以我不确定框架是否会有那么大的帮助。如果您的网络服务器支持,您可以在每次应用运行时请求资源文件,但要添加
if-modified-since
标头,以便您仅在版本可用时才下载新副本该服务器比您的应用程序已有的服务器更新。You can't update the resources in your app bundle without updating the entire application. However, there's no problem with having your app retrieve resources from a web server and save them in your app's Documents folder. From there, it's simple to have the app look for its resources in the Documents folder before looking in its own bundle.
I don't know of any frameworks that manage resource versions for you. There's not a lot of work involved, and each app likely has its own requirements, so I'm not sure that a framework would help that much. If your web server supports it, you could request the resource file(s) each time your app runs, but add the
if-modified-since
header so that you only download a new copy if the version on the server is newer than the one your app already has.我也有类似的问题。我曾尝试从我的 ftp 域下载一些自定义文件,但这确实效果不佳。不仅我必须支付带宽费用,用户对此也不是很满意。编码相当复杂。现在,我决定通过 AppStore 定期更新。用户因为看到更新而更加满意,但他们不明白的是,只更新了少数资源。
PS:我不知道有任何 SDK 或框架。但你不需要它,你只需要下载一些文件......
I also had similar problems. I had tried to download some custom files from my ftp domain but that really didn't work very well. Not only I had to pay for the bandwidth, the users weren't very happy about it. The coding complicated considerably. Now, I've decided to update periodically via AppStore. The users are more satisfied since they see updates, but they don't understand is that only a couple of resources have been updated.
PS: I'm not aware of any SDK or framework for it. But you don't need it, you just need to download some files...