iPhone Application and programming Updates
When a user logs into my iPhone App. I store their userID and relevant information in [NSUserDefaults standardUserDefaults]. This way they are not required to log in each time they access my application.
When my application is live in the app store and I make updates to the code will this information be lost - will they then be required to log in? If so how do I go about preserving this information when I make updates?
And while I can't image this happening but should a user choose to delete my application after they have installed it - how would I know that they have deleted开发者_StackOverflow社区 it? I am using the push notifications and would like to flag the user as not being active so that I don't keep pushing out notifications to them.
Thanks Very Much Cheryl
Only testing would confirm how the update process for your application works. Here is what the document says:
Files Saved During Application Updates
Updating an application replaces the previous application with the new one downloaded by the user. During this process, iTunes installs the updated application 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/Preferences
Although files in other user directories may also be moved over, you should not rely on them being present after an update.
Details here http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/RuntimeEnvironment/RuntimeEnvironment.html
The Feedback Service
If a provider attempts to deliver a push notification to an application, but the application no longer exists on the device, the device reports that fact to Apple Push Notification Service. This situation often happens when the user has uninstalled the application. If a device reports failed-delivery attempts for an application, APNs needs some way to inform the provider so that it can refrain from sending notifications to that device. Doing this reduces unnecessary message overhead and improves overall system performance.
For this purpose Apple Push Notification Service includes a feedback service that APNs continually updates with a per-application list of devices for which there were failed-delivery attempts. The devices are identified by device tokens encoded in binary format. Providers should periodically query the feedback service to get the list of device tokens for their applications, each of which is identified by its topic. Then, after verifying that the application hasn’t recently been re-registered on the identified devices, a provider should stop sending notifications to these devices.
http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingWIthAPS/CommunicatingWIthAPS.html#//apple_ref/doc/uid/TP40008194-CH101-SW1
精彩评论