当 iOS 应用程序即将被 iTunes 或 App Store 更新时在运行时收到通知?
Get notified at runtime when iOS App is about to being updated by iTunes or App Store?
当OS即将更新同一个应用程序时,在一个运行iOS应用程序中有什么方法可以接收通知吗?可以释放资源吗?
我们目前遇到的应用程序问题是,当通过 iTunes 更新 运行 应用程序(即用较新版本的应用程序替换它)时,进程停止并且应用程序的先前版本仍然存在活跃。
这可能是由于活动应用程序当时正在后台播放音频。
所以理想情况下,我想在该应用程序的更新过程开始时释放资源并停止音频播放。我该怎么做?
这是对发生的事情 AFAIK 的粗略描述:
- 版本 1 中的应用程序已安装并 运行,正在播放音频
- 新版 IPA(第 2 版)添加到 iTunes
- 应用已设置为更新,设备已设置为同步
- 开始从 iTunes 更新 运行 应用程序
症状:
- 应用更新开始
- 应用程序的图标在短时间后停止/停留在"Installing..."进度状态
- 无法通过这个停滞的应用程序图标启动应用程序
- 之前版本的应用程序仍然是运行(即音频仍在播放)
如果我先结束 运行 应用程序,然后通过 iTunes 开始更新,一切都很好(当然...)
好吧,我认为您的应用程序 运行 与正在安装的应用程序无关。
When a user downloads an application update, iTunes installs the
update in a new application directory. It then moves the user’s data
files from the old installation over to the new application directory
before deleting the old installation. Files in the following
directories are guaranteed to be preserved during the update process:
<Application_Home>/Documents
<Application_Home>/Library
Although files in other user directories may also be moved over, you
should not rely on them being present after an update.
所以基本上它是一个全新的应用程序,只是您的文档得到了保留。
当OS即将更新同一个应用程序时,在一个运行iOS应用程序中有什么方法可以接收通知吗?可以释放资源吗?
我们目前遇到的应用程序问题是,当通过 iTunes 更新 运行 应用程序(即用较新版本的应用程序替换它)时,进程停止并且应用程序的先前版本仍然存在活跃。
这可能是由于活动应用程序当时正在后台播放音频。
所以理想情况下,我想在该应用程序的更新过程开始时释放资源并停止音频播放。我该怎么做?
这是对发生的事情 AFAIK 的粗略描述:
- 版本 1 中的应用程序已安装并 运行,正在播放音频
- 新版 IPA(第 2 版)添加到 iTunes
- 应用已设置为更新,设备已设置为同步
- 开始从 iTunes 更新 运行 应用程序
症状:
- 应用更新开始
- 应用程序的图标在短时间后停止/停留在"Installing..."进度状态
- 无法通过这个停滞的应用程序图标启动应用程序
- 之前版本的应用程序仍然是运行(即音频仍在播放)
如果我先结束 运行 应用程序,然后通过 iTunes 开始更新,一切都很好(当然...)
好吧,我认为您的应用程序 运行 与正在安装的应用程序无关。
When a user downloads an application update, iTunes installs the update in a new application directory. It then moves the user’s data files from the old installation over to the new application directory before deleting the old installation. Files in the following directories are guaranteed to be preserved during the update process:
<Application_Home>/Documents
<Application_Home>/Library
Although files in other user directories may also be moved over, you should not rely on them being present after an update.
所以基本上它是一个全新的应用程序,只是您的文档得到了保留。