PlayerPrefs deleted after IOS app update

Hi,

I lost my PlayerPrefs after updating the game on iOS. I don’t understand the cause of this issue, because I don’t make any reset on PlayerPrefs on code, and previous update didn’t has this issue. What could be the reason? In this update I added OneSignal as Push notification service

Thanks in advance

jordi

I think this could happen if you modify some values of PlayerPrefs, but then you don’t call PlayerPrefs.Save and the application crashes or is force closed (such as when updating the game), so the changes are never saved. Calling PlayerPrefs.Save() after making any important changes to PlayerPrefs should prevent this problem.

The documentation for the Save method talks about this: Unity - Scripting API: PlayerPrefs.Save

Thanks, but the PlayerPrefs have been deleted in all iOS devices… In android there’s no issue

Which version of Unity are you using?

Facing the same problem. On iOS update, player prefs got deleted, causing collected coins, and other in game goods along with tutorial states got cleared. We were using Unity 5.1.1.f1 when we encountered this problem.

This topic is a little old but we’re experiencing the same issue. Users are reporting that all game progress is lost after installing an update. We haven’t been able to reproduce it. We’ve been experiencing this issue on both iOS and Android intermittently since Oct 2015. We’re often at the latest patch.

gdeglin - Have you been able to reproduce this issue? We will attempt to reproduce this problem based on the conditions you described.

Thanks :slight_smile:

We would be interested in any information you can find. Unfortunately we could not reproduce the problem either.

In our situation I think what’s happening is the game is crashing and somehow causing the app container to be reset. The user does an update, starts the game up and all their progress is lost so they blame the update.

I have personally only seen our game crash on 2 occasions where upon restart the app container has been reset. We save some things to player prefs and our players progress to a file, it all gets erased.

This doesn’t happen often but when you have thousands of people playing your game everyday the reports start to add up.

I have setup a couple of test projects to try and reproduce this bug but haven’t had any success :frowning:

FYI there’s also this known issue, which might be related (though it’s more than one year old IdentifierForVendor changed unexpe… | Apple Developer Forums)