Still, if it’s a string and you never convert it to a number it should stay a string and running in to maxint shouldn’t come into play. I just did a test on Windows in a clean/new project with just these two lines of code:
system.setPreferences("app", {userID = "123", facebookID = "12345678901", username = "Testuser"}) print(system.getPreference("app", "facebookID", "string"))
And it printed 12345678901, so if I never treat the value as a number, I get the full 11 character string. I changed it to:
local facebookID = "12345678901" system.setPreferences("app", {userID = "123", facebookID = facebookID, username = "Testuser"}) print(system.getPreference("app", "facebookID", "string"))
I also got 12345678901. So Lua isn’t doing a number conversion along this process. I made a slight change:
local facebookID = 12345678901 system.setPreferences("app", {userID = "123", facebookID = facebookID, username = "Testuser"}) print(system.getPreference("app", "facebookID", "string"))
and it printed:
1.23457e+010
which means it overflowed Lua’s ability to represent a number as an integer (all numbers are double floats, but Lua uses some trick of using doubles to represent int’s as ints) so it represented it as a double float and that’s probably the appropriate value.
I would look through your code and make sure you’re not treating the value as a number somewhere. You can copy and paste the code above into a new project and see if you get the same results.
Rob