I updated my game in stores (Steam, AppStore, PlayMarket).
Saving/loading the game has stopped working (ios).
Windows - work
Android - work
iOS - don’t work
https://docs.coronalabs.com/api/library/system/pathForFile.html
My code:
-- save/load data function saveData() if(options\_hotseat == false)then local path = system.pathForFile( options\_save\_fname, system.DocumentsDirectory ) local file = io.open( path, "w+b" ) if file then local save\_str = Json.Encode(login\_obj); file:write(save\_str); io.close( file ) else -- print("Saving: fail!") end end end function loadData() local path = system.pathForFile(options\_save\_fname, system.DocumentsDirectory); local file = io.open( path, "r" ); if (file) then local contents = file:read( "\*a" ); if(contents and #contents\>0)then login\_obj = Json.Decode(contents); else -- print("Loading: fail! file is empty."); end io.close(file); else login\_obj = {}; -- print("Loading: fail!"); end end
On iOS game always begins anew.
Thanks.