This is my code which works perfectly. When I add one more entry into title data like data.Add(GemsKey, "2"); It gives error: KeyNotFoundException: The given key was not present in the dictionary.
But if I replace one of existing entries with data.Add(GemsKey, "2"); It works fine too. Can anybody tell me whats the exact issue ? P.s: I'm using it on Unity3D...
public static Dictionary<string, string> InitialUserData(bool fb) { Dictionary<string, string> data = new Dictionary<string, string>(); data.Add(TotalEarningsKey, "0"); data.Add(ChatsKey, ""); data.Add(EmojiKey, ""); if (fb) { data.Add(CoinsKey, StaticStrings.initCoinsCountFacebook.ToString()); data.Add(AvatarIndexKey, "fb"); } else { data.Add(CoinsKey, StaticStrings.initCoinsCountGuest.ToString()); data.Add(AvatarIndexKey, "0"); } data.Add(GamesPlayedKey, "0"); data.Add(TwoPlayerWinsKey, "0"); data.Add(FourPlayerWinsKey, "0"); data.Add(TitleFirstLoginKey, "1"); data.Add(FortuneWheelLastFreeKey, DateTime.Now.Ticks.ToString()); return data; }