Cloud save not working on Android
Posted: Mon May 02, 2022 7:52 pm
I'm working on some silly project and wanted to try out the cloud saving capabilities of ES3.
It works great on WebGl and in the unity editor but seems to do nothing on android 12.
I have this code:
I tried searching with logcat but there is just nothing. No error or mention of any of this.
It always defaults to my Admin account and nothing else.
It works great on WebGl and in the unity editor but seems to do nothing on android 12.
I have this code:
Code: Select all
void Start()
{
StartCoroutine(StartEnum());
}
public IEnumerator StartEnum()
{
yield return StartCoroutine(LoadEnum());
if(ES3.KeyExists("LastLogin","local.es3"))
{
SimpData lastLogin = ES3.Load<SimpData>("LastLogin", "local.es3");
Name.text = lastLogin.SimpName;
Password.text = lastLogin.SimpCode;
}
}
public IEnumerator LoadEnum()
{
yield return StartCoroutine(Sync());
if (ES3.KeyExists("simpDatas"))
PersistantData.simpDatas = ES3.Load<List<SimpData>>("simpDatas");
else
{
PersistantData.simpDatas = new List<SimpData>();
SimpData simpData = new SimpData();
simpData.SimpName = "Admin";
simpData.SimpCode = "Admin";
PersistantData.simpDatas.Add(simpData);
}
}
public IEnumerator Sync()
{
var cloud = new ES3Cloud("MyServer", "MyAPIKey");
yield return StartCoroutine(cloud.Sync("simpDatas.es3"));
if (cloud.isError)
Debug.LogError(cloud.error);
}
It always defaults to my Admin account and nothing else.