Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloud Saving from a web page in Google Play Services

Tags:

Is it possible to create and load cloud saves in google play services from a webpage (via REST I imagine)? I can only seem to find documentation for saved games for C++/Android code.

like image 301
Chris Jefferson Avatar asked Aug 08 '17 09:08

Chris Jefferson


2 Answers

You may check Get Started with Play Games Services for Web.

The REST API for Google Play games services allows you to issue REST calls to set and retrieve game services data from your web game. You can also use the Management API to make REST calls to reset the game services data and perform other administrative functions.

Note: Links to sample code were provided in the page as well. For the games to work properly, you need to set up your own versions in the Google Play Developer Console.

like image 66
MαπμQμαπkγVπ.0 Avatar answered Oct 04 '22 18:10

MαπμQμαπkγVπ.0


All of these methods require authentication and authorisation.

To get a saved game from the REST API call:

https://www.googleapis.com/games/v1/snapshots/{ID of save}

To get a list of saved games:

https://www.googleapis.com/games/v1/players/{me | ID of player}/snapshots

Saving a game is messier, as you have to use the drives API to create the file:

https://www.googleapis.com/upload/drive/v2/files
like image 22
Keith Avatar answered Oct 04 '22 20:10

Keith