question

Freddy Rose avatar image
Freddy Rose asked

Game Circle login complete event?

Hello I am trying to implement the Game Circle into my app. I have everything working except for the login button. When Game Circle initializes, it shows a dialog box at the bottom of the app that says "Welcome Guest" with the option to click and log in. But, if the user doesn't click that link fast enough, the dialog window goes away and there is no other way for the user to log in. So, I have a button on my main activity as well that will allow the user to log into Game Circle. It works fine. The user clicks it, and it brings up the Amazon login screen. The problem is, that there doesn't seem to be any event notification when the login process is completed. My onResume event runs, but there is no way to determine if the onResume is from the Amazon login, or some other event. And sometimes when you click the login button, it will go back to my main activity first, then open the Amazon login window, which fires the onResume event multiple times. Is there an event notification that can be used to determine when the login process has completed? This is the code I am using in the onClick event for my login button. public void onAGLoginButtonClick(View view) { if (m_AmazonGamesClient != null) { m_AmazonGamesClient.showSignInPage(m_RequestPlayerProfileResponse);// acClient.getAchievements(); } else { if (m_TriviaAppInstance.isGameCircleConnectionInProgress() == false) { m_TriviaAppInstance.setGameCircleConnectionInProgress(true); AmazonGamesClient.initialize(MainActivity.this, m_AmazonGamesCallback, myGameFeatures); ShowMessage("Amazon Game Circle is not finished initializing. One moment please.", "Not Initialized"); } else { ShowMessage("Amazon Game Circle is not finished initializing. One moment please.", "Not Initialized"); } } }
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Freddy, There is no provision to detect the authentication event In GameCircle SDK (Android or Unity) at this moment. Sorry for the inconvenience, but we have noted your request have forwarded it to the SDK team. This feature is already requested here : https://forums.developer.amazon.com/forums/thread.jspa?threadID=1919
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mound-he avatar image
mound-he answered
Hi, There is a work around for this problem. Each time player return from background, we check max 15 times every 2 seconds if playes has been authenticated by doing AGSProfilesClient.RequestLocalPlayerProfile() and checking if it's not null.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Freddy, I would suggest you should not build in additional logic to determine if the player is logged in since that could be broken with future updates. We are looking at adding this functionality shortly. GameCircle attempts to abstract the concept of logged in/logged out from developers in our SDK. Our hope is to remove the need for developers to build logic around the auth state. We try to do this by providing a guest mode. This allows developers to blindly submit scores, unlock achievements and save sync data even when the customer is logged out. GameCircle will store the data locally on the device. When the customer next logs in, GameCircle will automatically sync all of that data to the cloud. Developers can even access the local player data that is stored on the device.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Todd Moore avatar image
Todd Moore answered
This whole guest thing makes it extremely hard to provide anything useful to the end user. When they attempt to login they get a prompt of empty stuff and there is no sign-in button on our Kindle 1st gen. If you don't allow a guest user to sign-in then what's the point?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Moore, The issue you are seeing in the Kindle 1st Gen devices with the guest mode is actually a issue with OTA. The devices did not receive the latest OS release through OTA. As a result, the GameCircle client (which comes with the OS) is outdated and not compatible with the current version GameCircle SDK. So these devices (do not have latest GameCircle Client installed) can not recognize the the current Kindle user. Related post : https://forums.developer.amazon.com/forums/thread.jspa?threadID=2077&tstart=0 The issue is already reported to appropriate team and we are working on it. In this current thread we discussed about introducing a new event to expose to app to detect the login activity of the user to optimize the SDK calls from app. The feature is already planned for future release. And that's the reason I said in the last post: "You should not build in additional logic to determine if the player is logged in since that could be broken with future updates. We are looking at adding this functionality shortly."
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

shifulin avatar image
shifulin answered
Hi, I'm using the GameCircle package for Unity. I'm able to test the functionalities when testing with some buttons like the demo application, but when trying to integrate it within our app and doing stuff programmatically, I'm running into some issues like mound_he mentioned. I'm not sure what are the best practices/guidelines on how to implement GameCircle within an app. 1) When are we suppose to call the function to get the local player profile? One signed through the Amazon interface and coming back to my app, I have the issue where an immediate call (in the ServiceReadyHandlercallback) to get the local player profile will fail. Am I suppose to wait x seconds before making the call? 2) You say we developers shouldn't handle the authentification state and that we can "blindly" submit scores, unlock achievement and such. When I do so in "guest mode", i get "AmazonGameCircle: GameCircleManager - submitScoreFailed" or "AmazonGameCircle: GameCircleManager - updateAchievementsFailed" with the error "UNRECOVERABLE". These function calls succeed when I'm logged into my game circle account. Also, when showing the achievements in guest mode, it says 0/0 achievements earned. 3) Basically, I'm wondering what are the best practices/guidelines/workflow on how to implement GameCircle into a game with the current SDK. For exemple, should we check if the player is logged in? If so, how? When to get the player profile? If the player is not logged in, should we ask him to log in through a button or should we blindly continue to call the achievement and leaderboard calls? We've implemented iOS GameCenter and Google Play Game services in our apps and they have their guidelines but I don't see it for Amazon Game Circles. These test are on a non-kindle device (Samsung Galaxy S3) Thanks.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

dingetje61 avatar image
dingetje61 answered
I'm currently implementing GameCircle services in my Android game and ran in the exact same issues. The last post in this thread is over a year ago, are there any updates in the SDK that address these issues?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

DougM@Amazon avatar image
DougM@Amazon answered
Hello dingetje61, We have added a callback to see when GameCircle customers have logged in or not. If you create an AGSignedInListener: https://developer.amazon.com/public/binaries/content/assets/javadoc/gamecircle-api/2_4/reference/com/amazon/ags/api/player/AGSignedInListener.html and implement the onSignedInStateChange, you should be able to determine if a customer is logged in with their GameCircle account prior to attempting to change the leaderboard/achievement data within your app. Whispersync should still function anonymously but will allow for you to save progress to a customer as long as they sign in at some point to allow for cloud synchronization between multiple devices for your game. https://developer.amazon.com/public/binaries/content/assets/javadoc/gamecircle-api/2_4/reference/com/amazon/ags/api/player/AGSignedInListener.html#onSignedInStateChange(boolean)
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.