Is GamesClient.submitScore require online connection? How exactly is it working when user is offline? Scores to submit are saved in some sort of queue to execute when there is something to do or I must first save scores locally and then update it on Google Play GAme Services?
yes it requires a network connection. However what you could do is use SharedPrefrences for when the user signs back in. This is what I did in my app. you just have to make sure the same person who is playing offline is the same one who will sign in later.
Hope this helps!
Related
I'm developing an Android app that's in beta that downloads music tracks from a separate server. To ensure that the app's purchase functionality is working correctly, I need to rescind the purchases (not just refund from the Dev Console), but the Play Store holds this locked up somehow so that I can't reverse Google Play's record of the purchase. So... my app can't return to the "haven't purchased" state. I've look everywhere for an answer to this. I can't believe that it's not a common issue, or maybe I don't know what exactly to search for.
TIA
I'm developing a client and a server for online game. To make login process easier for users we planning to make enter in game via Google Play Services account.
The problem is that authentification proceeds on client side only, but server needs to create some account for authetificated user too, to store info about his achievements, items and so on.
The question is - how to do it? Which info from Player Services we could store to create account, and authentificate user in further?
Maybe someone had similair experience, i think there should be some simple solution for that.
If you want to setup your Google Play Service using client-server, then I think this documentation can help you with that. It explains here the step by step procedure that you need to do in order to setup the Google Play Service. For more information just read the above link and check this thread. Also, if you want the client-only then this link will help you.
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.
I'm developing a game for android. I use the google play services for the multiplayer functionality.
I want to integrate an ingame currency, which is reset to a fixed amount every day. Every game round the user plays will cost him 1 coin of this currency. Additionally i want to integrate in-app purchases to buy packages of coins, which are indepentant from that daily amount of coins.
My question concerns the date request when starting the app, which decides wether the user gets coins for that day, or if he already got them. If i just fetch the local date, the user could just change the phones date and get the coins even if he already got them for this day. So my question is, whats the best way to get the current date? I already use the google play services, so is there a way to fetch the date from there ? Otherwise, that needs the user to be connected to the internet. Any suggestion on this ?
Another question is, where to save the coins. Locally would be the easiest option. But is it safer to use the google play services cloud stuff for this too ? That would have the advantage to work cross device.
If you can't trust the user's device you may want to get time from an external server that you control.
For storing the coins remotely, please check out the Google Play Saved Games Service. You can store arbitrary data there and use it to sync coins and other information across a user's devices.
I wonder if it is possible to sign in multiple player at the same time or store the login-info somehow for Google play games services. I developed a scorepad app and would love to sync games from different devices with the PlayGames-Accounts of the players. They are all present and play with one device. So it would be useful if different players can stay logged in on this device. Is this possible? Actually they dont have to be logged in at the same time, but it would be nice if they would only have to enter their login-data once on each device.
What do you think?
Thank you for your thoughts
Frank J.
It's possible to sign in and out of an account associated with Google Play Games on an Android device. The separate accounts will have private leaderboard scores, achievements, cloud saves, and so on.