Reputation: 466
Is there any way to receive notification inside a running iOS App when the OS is about to update the same App so it can release resources?
The problem we currently encounter with an App is that when updating the running App (i.e. replacing it with a newer version of the App) through iTunes then the process stalls and the previous version of the App remains active.
This may be due to the fact that the active App is playing audio in the background at that moment.
So ideally I'd like to release resources and stop the audio playback when an update process for that App is started. How do I do that?
Here's a rough sketch of what's happening AFAIK:
Symptoms:
If I first end the running App and then start the update through iTunes everything is just fine (of course...)
Upvotes: 0
Views: 127
Reputation: 12405
Well I think the fact that your application is running has nothing to do with app being installed.
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.
So basically it is a completely new app, just that your documents are preserved. https://stackoverflow.com/a/5226037/919545
Upvotes: 1