Help, PlayerPrefs doesn't seem to work and can't figure out why.
I have a simple game that starts with:
void Start()
{
if (PlayerPrefs.GetInt("IsReturningUser") == 1)
{
ScoreLabel.text = "Welcome back, friend!";
}
else
{
PlayerPrefs.SetInt("IsReturningUser", 1);
ScoreLabel.text = "Welcome new player";
}
When testing on my Android device from Unity Editor (build and run while connected) it works as intended - when I return to app second time it detects I'm returning.
However when I published the same code to Google Play store and clean installed from there, it never detects I'm a returning user when I return to app the second time.
Also strange, while it doesn't work on my Android phone, on my wife's phone installed from the Play Store it does detect as a returning user when she opens it the second time.
Any ideas?
Unity 5.3.6 My phone - Redmi Note 3, Android 6.0.1 MIUI 8.2 Stable Wife phone - OnePlusX