question

highbrow-inc avatar image
highbrow-inc asked

Getting user information from Gamecircle

Hi, I'm trying to include Gamecircle as one of the login method to our game but I can't find a method to get the user information of the client. It seems that Gamecircle api only provides user information list of Achievements, Leaderboard and etc. So I've tried Login with Amazon which is what I want to do with Gamecircle account, hoping by logging into Amazon will automatically login to Gamecircle. However, it seems login with amazon SDK conflicts with Gamecircle SDK and I cannot even build...... Can you please tell whether Gamecircle provides such api or I just have to come up with another method?? Thank you.
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 Highbrow-inc, Thank you for reaching out. Yes we do have API for getting player information in GameCircle SDK AmazonGamesClient.getInstance().getPlayerClient().getLocalPlayer().setCallback(new AGResponseCallback () { @Override public void onComplete(RequestPlayerResponse requestPlayerResponse) { System.out.println("Player Alias = " + requestPlayerResponse.getPlayer().getAlias()); System.out.println("Player Id = " + requestPlayerResponse.getPlayer().getPlayerId()); } }); Please refer : https://developer.amazon.com/public/binaries/content/assets/javadoc/gamecircle-api/reference/com/amazon/ags/api/player/package-summary.html
10 |5000

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

highbrow-inc avatar image
highbrow-inc answered
Hi, Thank you for the information, I think it solved the problem I had. But I ran into another problem..... I can't seem to find listener example for when sign in is done. I know there is showSignInPage and callback but I cannot find example for the listener....
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
AmazonGamesClient.getInstance().getPlayerClient().setSignedInListener(new AGSignedInListener() { @Override public void onSignedInStateChange(boolean isSignedIn) { } }); https://developer.amazon.com/public/binaries/content/assets/javadoc/gamecircle-api/reference/com/amazon/ags/api/player/playerclient.html#setSignedInListener%28com.amazon.ags.api.player.AGSignedInListener%29
10 |5000

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

highbrow-inc avatar image
highbrow-inc answered
Hi, Thank you for all the replies and answers. All my problems have been solved so far. But I ran into another issue today. When I show the sign in page, is there way to know whether user has pressed back button and close the sign in page? Thank you
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, No. There is no callback available to track the close event. Could you please let us know why do you need it. I mean the use case.
10 |5000

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

highbrow-inc avatar image
highbrow-inc answered
Hi, Our game is developed with cocos2d-x and when sign in page shows up, we block the touches for the game so when users press the back button the game has to allow touches again....
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, Can you please let us know the reason of doing this? I mean, why do you need to block user interaction before launching signing page? Do you get event back for all other SDKs made for coscos2d-x in similar case?
10 |5000

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

highbrow-inc avatar image
highbrow-inc answered
Hi, Otherwise, the Login popup will get called over and over again. Also I have another question about getPlayerId and getAlias. If I call getAlias I get nothing, just empty string, and if I call getPlayerId I get the players nickname which can be changed I assume(?). If the nickname cannot be changed there is no problem for me to use it as Id but if it's possible I need another method.. Is using getPlayerId safe to use it as unique Id for the game? Thank you
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 highbrow-inc, Thank you for writing back. Few things. 1. Why the login popup would be called over and over? Can't you detect a single touch event in cocos-2d and initiate the login? What happens with other non Amazon SDKs, if you bring a view over your cocos app, do you restrict the touch input there and keep that blocked till you are coming back from popover view to your app? Please clarify. Because, I need to be very sure about the use case before taking it to the next level. I never worked on cocos 2d before. 2. You should always get the players nickname through getAlias() method if you are logged in successfully with GameCircle. Are you logged in successfully and still you do not receive the nickname through getAlias(). That should not happen. Please confirm and report. 3. Yes, getPlayerId() should be safe to use. It returns a unique string identifying this player, or null if it was not initialized. Please check the API ref : https://developer.amazon.com/public/binaries/content/assets/javadoc/gamecircle-api/reference/com/amazon/ags/api/player/player.html#getPlayerId%28%29
10 |5000

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