Sadly, when my App is updated there is some saved data or left over logic that was already implemented. This can cause some bugs to occur. Is there a way to tell if an App was updated so I can make the user relogin? Any tips or suggestions are appreciated.
You can save the installed version in the NSUserDefaults. They will persist during app updates, so whenever your app launches you check for the saved version, compare it with the current version and do your migration if necessary. At the end, save the new version to the same key.
Related
In iOS app version 1, I am storing each and every data in table in encrypted form. But In iOS app version 2, I have removed the encryption of those data in each and every table. During app upgrade from version 1 to version 2, since the older version has encrypted data, the new version is not able to understand the data fetched. How should I go about this?
iOS application - supporting till OS 12.
So you have not decrypted the data during the migrating from version 1 to version 2. Have you stored the key to encrypt/decrypt in keychain or do you have access to the key to decrypt the info in version 2.
If you store data within app database after encryptions then don’t need to worry. Nothing will happen with the older version of your app if you upload next version. Only the changes will not reflect directly to the previous version of your app you have to forcefully update an app version from the user.
You can show the alert massage when user open the application like “new version is available please checked” and redirect to the App store.
There can be two options and might one of them will help you.
Option : 1
You can ask end-user to make force update and update the new version of an existing installed app.
Option : 2
If you don’t want users to loose there existing data what you need to check is…
With the new version of the app, you need to check whether old data exist in the application or not.
If YES, you can update them by making it decrepit and if the answer is NO there you can make the user access your application further.
With this approach make sure users are having a good experience and don’t get annoyed if you perform background tasks while updating the existing data to decrypted one.
Hope the above explanation can assist you.
This is possible on Andriod. I wonder if it is possible on iOS. I have explored it, found no information. If you have any source/information, please direct me.
Thanks.
No, There is no notification triggered when an app is updated from the store, whether your app is running or not.
Previously I have stored a property in UserDefaults of the current version running and each time the app starts or is opened I check to see if the actual version is different from my last known in UserDefaults. Then if needed run any migrations or whatever are needed.
My application was previously written in Titanium. Now, I have released a new version where the code is written in Swift. Now after the user updates his app to this version and starts the app, it crashes. Then it again starts running fine when the user deletes and installs the app back. What can be the best way to detect this change in the app? I have thought of a solution. I can check if some key in NSUserDefaults is set or not and delete and refresh and start again.
Maybe because titanium save something in the iOS memory-cache for inizialitze it. And then when users delete the application delete this cache too, maybe a good whay for fix this is clean the cache when inizialize your new application for first time.
I have an iOS game that saves game progress using NSUserDefaults. After the last update a user had a problem, the app was not working anymore on this device. The app doesn't have any problem, but for some reason an error occurred while downloading the app, not quite sure what happened.
The point is, the app must be deleted and reinstalled. Can this be done without erasing NSUserDefaults?
I tried syncing with iTunes here after deleting the app, even installing it again through iTunes but I was unable to restore the previous saved game on my test devices.
I guess the only way to reinstall the app is through an app update. When it comes out he will update and will not lose any data. Is this correct? Or is there any other way to do this?
I'm working to implement cloud syncing on the next update, so this problem should not be an issue again :). But right now, is there anything and I do to this user?
Cloud sync would be the solution. If you using your iPhone only once the app is deleted every thing related to it is gone with no easy way to retrieve it.
Or just store data that needs to be persistent in the keychain.
Restoring the device from an iTunes Backupd probably reinstalls the app and also keeps the NSUserDefaults, assuming they are included in the backup.
However, this needs to be done by the user ...
Some syncing option is the better solution on the long way.
I have a app working fine and it is already submitted to app store. Now the problem comes in when the users of my app try to update the app with the latest version from the app store. The app crashes at splash screen.
If they delete the old version and make a fresh download then it does not pose any problem.
So what could be the factors causing this problem ?
Thanks in advance.
Do you use CoreData in your project?
If yes, did you make any changes to database model?
If yes, did you make new version of database model?
If you didn't create new version of database model but just modify first version then it causes crash.
-> Check there crash logs