I am trying to incorporate a simple high score into my game using Google cloud data.
So far I followed the steps outlines in the documentation for SetupCloudData although I am not sure if that requires verification by Google before it will work? Does anybody have insight into this?
When calling SetupCloudData I am unclear as to why there is a requirement to pass a string as a parameter. However it seems to be working fine.
I am using the following code:
std::string cloudstring;
agk::SetupCloudData(cloudstring.c_str());
cloud_setup_completed = true;
Which is bringing up a window on the mobile device asking which google account to proceed with and indicating that google will share the email address and profile picture with my app.
When the game ends I am sending the score to the cloud using this code:
std::stringstream highscore_string;
highscore_string << score;
agk::SetCloudDataVariable("myapp.highscore", highscore_string.str().c_str());
When the game loads I am retrieving the score with this code:
cloud_highscore = agk::GetCloudDataVariable("myapp.highscore", "0");
Unfortunately the string is filled with "0" which is the default value if the cloud variable doesn't exist or is empty.
If anybody can let me know if they have experience with google cloud data storage please let me know what the issue might be.