Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / Google cloud data storage/retrieval

Author
Message
JonEnstrom
3
Years of Service
User Offline
Joined: 27th Apr 2020
Location:
Posted: 30th Aug 2020 23:04
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.

TamBam
12
Years of Service
User Offline
Joined: 29th Nov 2011
Location: India
Posted: 13th Oct 2020 21:10
hi if you want to submit high score then use firebase and it's free.

Login to post a reply

Server time is: 2024-03-29 13:48:33
Your offset time is: 2024-03-29 13:48:33