Closed johnhattan closed 10 years ago
Hi, thanks for the report.
About the login method, that's something that is not clear on Google Documentation either (as it depends on what you want for your game).
If you call the login after the init, your game will try to login on Google Play Games. This may annoy some people (since many people wants to try the game before deciding if they want to use Google Play Games or not).
For what I've seen, some games calls Login at the beginning and some others never call login at all (and waits for the user to click on "displayScoreboard" or displayAchievements, since calling those actions will call login automatically if it's necessary).
So, it's up to you to decide that...
Thanks!
PS: I've fixed the README examples :+1: Thanks
Thanks for the update and the clarification. That being said, is there a method to check if a user is logged in? I got a bug report from someone because the game crashed because it tried to post an achievement without the user being logged in. I don't know if that's allowed or not.
This is strange... the library checks if the user is logged in and return false if you're not logged into the game when you call GooglePlayGames.setSteps / reveal / unlock / etc.
You should be able to do something like:
if(!GooglePlayGames.unlock(....)) GooglePlayGames.login();
But you should consider counting how many times you've asked for the login to make sure you're not annoying your users (if they keep pressing 'cancel' to each login request). Mayme something like this will work:
static var loginCounter:Int=0;
...
...
if(!GooglePlayGames.unlock(....) && loginCounter<3){
GooglePlayGames.login();
loginCounter++;
}
Okay, thanks for the help. iOS GameCenter automatically starts returning false after three canceled logins, just to prevent the user from getting annoyed if he doesn't want to deal with it. GPG is new to me, so I'm still trying to wrap my head around how it's different from GC.
Yes... it's quite a pain. I'm considering adding some controls inside the extension to implement those kind of features for GPG (but I'm still waiting to see if some day google makes GPG a little bit easier to use).
So any ideas about how to make this less painful will be welcome :)
GooglePlayGames.showSocoreBoard should be GooglePlayGames.displayScoreboard
and
GooglePlayGames.setSocre should be GooglePlayGames.setScore
Also, it's not clear when/if I should use the "login" method. Should this be called immediately after "init", or should there be a specific button for it?