I'd like to design an Android game that has an in-game currency (coins) that can be earned by playing the game or can be bought with real money. This currency can then be spent on different upgrades.
Obviously I need to store the players' number of coins and the list of the upgrades they bought online, not to lose this information if they decide to uninstall the game. However, I don't have access to a server so I'd like to use the Google Play Services to store this information in hidden achievements / leaderboards.
My idea is to have two leaderboards set up: one for the total ammount of coins earned + purchased and one for the total ammount of coins spent. These leaderboards would be updated whenever the player earns coins or buys them with a consumable IAP (which is consumed immediately after the purchase so they can buy it again later), or whenever the player decides to spend some of their coins on upgrades. The upgrades themselves would be stored as achievements so if they buy something, the specific achievement would unlock.
This way all of the purchase information would be stored online and if the players reinstall the game, they wouldn't loose any progress: the list of purchased upgrades is stored in their unlocked achievements and the amount of their remaining coins is just the difference between the two leaderboards' scores.
This method also seems more secure than storing the information locally or establishing a connection to a custom server. And since the Play Services cache the data when offline and sync it later, the Store could be used without internet connection (apart from buying coins with IAPs of couse). The only downside is that it enfroces the Play Games sign-in so I'd have to check that before any transaction. Basically the entire "Store" menu would start with a Google Play Services sign-in.
My question is that do you see any problems with this solution? Is it possible to realize it or am I misunderstanding any of the concepts (I only have worked with non-consumable IAPs so far and the way to track consumables is a bit unclear for me). Is it breaking the Play Services terms of use (I also intend to create some traditional leaderboards and achievements so not everything would be hidden) ? And lastly, is there a simpler way to do this without using a server?
Thank you in advance :) Peter
This idea sounds inflexible. Why don't you just use the Saved Games API from Google? This will do essentially what you want to do with a proper API instead of using the leaderboard/achievement API. You can define any class to save your data to the cloud and sync across devices.
Plus, Google has some default UI for showing the leaderboards and achievements. If you want to use real (unhidden) leaderboards or achievements you'll have to write your own UI and filter out the hidden ones.