Hi, when i click achievements or custom leaderboard button i'm getting 'sign in required' error in my game. also when I build example scene of the asset there's the same error for achievements, however default leaderboard is shown correctly. This is the script -> https://paste.ofcode.org/Uu4e2e3aC3kaQr53uRneJ3
#Sign in required error
1 messages · Page 1 of 1 (latest)
Are you sure about calling leaderboards code after authentication only?
I click the buttons after signed in. You mean this pop-up right?
Did you call Authenticate method of Game Services?
yes it's here `private void Start()
{
if (isAuthenticated)
return;
if (GameServices.IsAvailable())
{
GameServices.Authenticate();
}
}`
it's in this script https://paste.ofcode.org/Uu4e2e3aC3kaQr53uRneJ3
i add those logs `private void Start()
{
if (isAuthenticated)
{
_infoLeaderboardTxt.text = "Already authenticated";
return;
}
if (GameServices.IsAvailable())
{
_infoAchievementsTxt.text = "Should be authenticate";
GameServices.Authenticate();
}
}`
and when the game opens it says 'should be authenticate'
but when i click custom leaderboard button this error is shown
also achievements doesnt work
Ok.
Can you please try running GameServicesDemo scene? If you notice the error over there too, can you add me a tester?
Sent you my email id in dm
yes it seems that im authenticated but it gives the same error
default leaderboards just works fine in demo but i want to use custom leaderboard and the same error is shown for that too
i added you as tester
here's the link of apk https://drive.google.com/file/d/1cEUjB6JfMLCZWSg1eRRx9UGZfhKanwFX/view?usp=sharing
Google Docs
this is the achievements button
hi, did you check it? @rotund dust
Yes. I can see the achievements displayed
Can you try with any other account to confirm?
After logging in, it directly showed up on clicking achievements icon.
in my developer account still doesnt show up
but i try with different account and it's shown now
that's weird
Yea!
thanks, now i'll try the leaderboard part
Sure!
hi i get an error in this script -> https://paste.ofcode.org/3biCkBAP8pPrzSLvei8kTNk` '[VoxelBusters.CoreLibrary] System.InvalidCastException: Specified cast is not valid.
at (wrapper castclass) System.Object.__castclass_with_cache(object,intptr,intptr)
at CloudSaveManager.LoadData[T] (System.String key) [0x00016] in C:\PersonalProjects\Wordle-Project\Assets\Scripts\CloudSaveManager.cs:70
at CloudSaveManager.LoadAll () [0x00001] in C:\PersonalProjects\Wordle-Project\Assets\Scripts\CloudSaveManager.cs:54
at CloudSaveManager.OnSynchronizeComplete (VoxelBusters.EssentialKit.CloudServicesSynchronizeResult result) [0x00017] in C:\PersonalProjects\Wordle-Project\Assets\Scripts\CloudSaveManager.cs:147 '`
Please share your code entries at CloudSaveManager.cs:70
private T LoadData<T>(string key) { string json = CloudServices.GetString(key); if (!string.IsNullOrEmpty(json)) { return (T)jsonProvider.FromJson(json); } return default; }
return (T)jsonProvider.FromJson(json); this is the 70
and i think the above link is broken so here's the full code of cloud save manager -> https://paste.ofcode.org/CGEwpGJsdsTFsatHAxMURW
If you already have a class which is serializable, better use JsonUtility from unity (not jsonproivder)
If you want to use jsonProvider (we provide default one), note that the data from jsonProvider.FromJson(json) is actually an object which in this case will be IDictionary<string, object> and can't be type casted to T.
yes i have 3 serializable class -> https://paste.ofcode.org/ZscbZDBMBkh4CZbjwA8skP and in game i use JsonUtility for that purpose
https://paste.ofcode.org/wHTdgXJtCJMnxHQ5gx7Y6D i replaced it with JsonUtility in here
and i add some debugs. when i run it, it says '[CloudSaveManager] Invalid or empty JSON for key 'commonPlayerData': '"CommonPlayerData"', [CloudSaveManager] Invalid or empty JSON for key 'playerDataTr': '"PlayerDataTr"', [CloudSaveManager] Invalid or empty JSON for key 'playerDataEn': '"PlayerDataEn"'
i have also this script before initialize the cloud save -> https://paste.ofcode.org/eAmyGGficzDjSie6hajSGX and then i added cloud save method in this script
i think i solved it! now i'll try it on the device