0

I'm implementing a leaderboard service with App42 Unity SDK. The basic workflow is to save user's score first time, get the returned score id as described in tutorials,store it in the device local SQLite DB and then update the user score with that score id periodically.

The issue is that score id returned as a string which may contain SQLite invalid characters. "0QE9+50fILUfGERTTRIxLvmRRH8=" is one of such. How would you deal with the issue?

Steven
  • 166,672
  • 24
  • 332
  • 435
Koshak118
  • 13
  • 5
  • Could you store the string value as a binary value? – Joseph D Surgeon Oct 13 '14 at 20:20
  • You can use your own custom encoding to replace +/= with some string and decode the same after fetching. – Ajay Tiwari Oct 14 '14 at 06:34
  • See this http://stackoverflow.com/questions/12615113/how-to-escape-special-characters-like-in-sqlite-in-android – Ajay Tiwari Oct 14 '14 at 07:15
  • Well, storing it as a binary blob was the easiest way. Just a little mess of storing and reading it back with kind of a limited API I've got to work with SQLite in Unity, but not more than a couple of hours. – Koshak118 Oct 14 '14 at 12:35

1 Answers1

0

You can save your score ID in PlayerPrefs as string instead of SQLite

PlayerPrefs.SetString("ScoreID", score.scoreID);
Cenkisabi
  • 1,066
  • 8
  • 25