Silviu's Recent Forum Activity

  • Hello! I am having troubles making the Google Play plugin to work. I am testing it now on a very simple game and I would really appreciate if someone can tell me what I am doing wrong. The game is just you pressing a button which increases a variable by one. When you press submit it should send the score to a leaderboard on Google Play and when your click another button you should retrieve that leaderboard. That's it! The code is like this:

    Global number score = 0

    (Google Play) On loaded

    ...(Google Play) Is loaded -> (Google Play) Sign in

    (Increase Button) On clicked -> (System) Add 1 to score

    (Submit Button) On clicked -> (Google Play) Submit score score (tag "") to leaderboard "leaderboardName"

    -> (System) Set score to 0

    (Leaderboard Button) On clicked -> (Google Play) Request public all-time hi-scores from "leaderboardName" (25 results, top)

    I exported it as Android (Cordova) -> Unsigned release APK. I signed it using these terminal commands (on Mac):

    keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

    jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk alias_name

    ./zipalign -v 4 Project1.apk Project1-aligned.apk

    I uploaded it on Google play (Clicked on Create application and followed the normal steps) and it is in the store. After that, in my Google Play account I went to Game Services, clicked on ADD NEW GAME, I added it and linked it to the game itself (from the android store, using the package name). Then I went on and created a leaderboard and used its name in my code (instead of "leaderboardName"). Then in Construct 3, in my Google Play object, I filled in my Application ID as it appears in Google Services, my Client ID, using my OAuth2 Client ID and my game ID using my package name (com.name.name). After I did all these (and changed the version of the code), I exported it again, signed it again and re-uploaded in on google play. When I download it, the game starts and the screen gets a bit dimmer as if something would be loading but nothing shows, and the game continues without any error (I should have had an automatic Log In, but it doesn't happen). Also when I try to submit the score or retrieve the leaderboard, nothing happens either. I am trying to figure this out for more than 2 weeks. Can someone please tell me what is wrong about my implementation or what else should I do in my Google Play account to make this work? Thank you!

  • Hello! I am having troubles making the Google Play plugin to work. I am testing it now on a very simple game and I would really appreciate if someone can tell me what I am doing wrong. The game is just you pressing a button which increases a variable by one. When you press submit it should send the score to a leaderboard on Google Play and when your click another button you should retrieve that leaderboard. That's it! The code is like this:

    Global number score = 0

    (Google Play) On loaded

    ...(Google Play) Is loaded -> (Google Play) Sign in

    (Increase Button) On clicked -> (System) Add 1 to score

    (Submit Button) On clicked -> (Google Play) Submit score score (tag "") to leaderboard "leaderboardName"

    -> (System) Set score to 0

    (Leaderboard Button) On clicked -> (Google Play) Request public all-time hi-scores from "leaderboardName" (25 results, top)

    I exported it as Android (Cordova) -> Unsigned release APK. I signed it using these terminal commands (on Mac):

    keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

    jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk alias_name

    ./zipalign -v 4 Project1.apk Project1-aligned.apk

    I uploaded it on Google play (Clicked on Create application and followed the normal steps) and it is in the store. After that, in my Google Play account I went to Game Services, clicked on ADD NEW GAME, I added it and linked it to the game itself (from the android store, using the package name). Then I went on and created a leaderboard and used its name in my code (instead of "leaderboardName"). Then in Construct 3, in my Google Play object, I filled in my Application ID as it appears in Google Services, my Client ID, using my OAuth2 Client ID and my game ID using my package name (com.name.name). After I did all these (and changed the version of the code), I exported it again, signed it again and re-uploaded in on google play. When I download it, the game starts and the screen gets a bit dimmer as if something would be loading but nothing shows, and the game continues without any error (I should have had an automatic Log In, but it doesn't happen). Also when I try to submit the score or retrieve the leaderboard, nothing happens either. I am trying to figure this out for more than 2 weeks. Can someone please tell me what is wrong about my implementation or what else should I do in my Google Play account to make this work? Thank you!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • >

    > >

    > > The manual notes to use APP ID for the GAME ID, and that is all that is required, but I added APP ID in APP ID and GAME ID and included the CLIENT ID anyway.

    > >

    > > APP ID and CLIENT ID can be found by going to Google Play game services, Linked Apps, and scrolling to the bottom.

    > >

    > > Click on the Google Play plugin under project in left column in Construct 3, enter the info in the properties column on the left, then give it a go.

    > >

    >

    > Hey thanks for this. I managed to make it Sign In automatically when I open the game. I see that you managed to make the Leaderboard work. Could you please tell me a bit about that? At the end of the game I do "submit score to leaderboard" and then I have a button which, on tapped, should "request public all-time hi-scores from ...". It seems that the submit part fails (I tested this in preview). I uploaded my game on Google Play Console, linked it to Android and Web app and I used in Construct 3 the Client ID from the Web app. As URLs I have https://preview.construct.net https://preview.construct.net/local and http://localhost. The app is signed and it can be well downloaded from Google Play. I guess I am still missing something from the Google Console setup. Any help would be greatly appreciated.

    >

    Great job getting your game to sign in.

    For the Leaderboard, here's what I am doing. And just for reference, this is an endless runner game.

    I set the score from a global variable when the player dies touch a sprite. I use the global variable for the score, leave tag blank, and then enter my leaderboard ID. Here is the event:

    + Player_move: On collision with NAME_OF_SPRITE

    -> GooglePlay: Submit score YOUR_SCORE_GLOBAL VARIABLE (tag "") to leaderboard "YOUR_LEADERBOARD_ID"

    Then to show the leaderboard, I have a graphic with a trophy, when the player clicks it, it shows the GooglePlay leaderboard that the score was submit to. Here are the events:

    + Touch: On touched NAME_OF_SPRITE

    -> GooglePlay: Display leaderboard "YOUR_LEADERBOARD_ID"

    Remember, in order to test, you need to sign the APK. So export as Android project, sign, and then install and test. Hope this helps.

    Hey, I did that, but it still doesn't work. Did you link the app with Web or with Android on google console? And did you do anything special to the leaderboard on google console, other that the obvious steps of creating it? Also it seems that the auto sign In doesn't work on the phone. On preview I allowed pop-ups and it works here, but on the phone it seems to be loading, but nothing shows.

  • I might be wrong on this, but I do not think they have any updated manual for their new GooglePlay Plugin. (Their old plugin was web based, and I think their manual still relates to the old deprecated plugin. The new plugin is native android)

    Oh this makes sense. So technically I should not have to connect to web at all. Yet, it should still work in preview mode when using the Web link (it is easier to test)...

  • I am not sure the functionality works for local preview, even if linked to web app.

    try to just link to android app. and test it within the real app.

    just to be sure, you have created a leaderbord correctly and linked it? with a correct numerical format

    Do you mean to use the App Id from the link with the Android app, not the one from Web App? I was actually confused by this, as in the manual they say to use Web app, but it seems more logical to link it to the android app directly... I will try it. I think I created it correctly. I followed a youtube tutorial, and seems quite straight forward, so I hope I did it right.

  • > Can someone tell me how to fix this?

    >

    No, not without any information.

    This is a issue with your Google setup, and I believe it is easier for you to get help on a google forum. The events in Construct is not that hard.

    If you want help, try to provide a full description of your events and the setup for your app in google console, and your game in Google Play.

    Then possible someone can help out.

    Also post stuff like this in the How do i section.

    Hey sorry for this. So I managed to make the Sign In automatically when I open the game. At the end of the game I do "submit score to leaderboard" and then I have a button which, on tapped, should "request public all-time hi-scores from ...". It seems that the submit part fails (I tested this in preview). I uploaded my game on Google Play Console, linked it to Android and Web app and I used in Construct 3 the Client ID from the Web app. As URLs I have https://preview.construct.net https://preview.construct.net/local and http://localhost. The app is signed and it can be well downloaded from Google Play. I guess I am still missing something from the Google Console setup. Any help would be greatly appreciated.

  • The manual notes to use APP ID for the GAME ID, and that is all that is required, but I added APP ID in APP ID and GAME ID and included the CLIENT ID anyway.

    APP ID and CLIENT ID can be found by going to Google Play game services, Linked Apps, and scrolling to the bottom.

    Click on the Google Play plugin under project in left column in Construct 3, enter the info in the properties column on the left, then give it a go.

    Hey thanks for this. I managed to make it Sign In automatically when I open the game. I see that you managed to make the Leaderboard work. Could you please tell me a bit about that? At the end of the game I do "submit score to leaderboard" and then I have a button which, on tapped, should "request public all-time hi-scores from ...". It seems that the submit part fails (I tested this in preview). I uploaded my game on Google Play Console, linked it to Android and Web app and I used in Construct 3 the Client ID from the Web app. As URLs I have https://preview.construct.net https://preview.construct.net/local and http://localhost. The app is signed and it can be well downloaded from Google Play. I guess I am still missing something from the Google Console setup. Any help would be greatly appreciated.

  • Hello! I am trying to test the Leaderboard in preview mode for Google Play, but it seems to not work. The Sign In works properly and I manage to choose my account. When the game finishes I choose the score to be sent to the leaderboard I have in my game on Google Play account. However, when I press a button in my game which should Request Public all-time high-scores from the same leaderboard, nothing happens. Can someone tell me how to fix this? Thank you!

  • I've managed to get a working achievements and leaderboard but the actual values aren't correct, perhaps due to a lack of "trigger once while true" conditions.

    Essentially I set it up as If (is boolean set)-> unlock achievement/submit score

    Then I go into my game services and locate the corresponding ID for the intended achievement/score and insert that into the action.

    Could you please post a SS of this?

  • > It's not an issue with the order of events. The sign-in basically fails. As a test I placed an -> on auto-sign in failed-sign-in event on the title page of my game and it is a continuously repeating instance of how you describe it: a dimming of the screen and the notification bar coming visible but nothing happening. Thus, it has to do with the setup of the google play plugin not the order of events.

    >

    Well, I got the auto-sign in to work! It loads the sign in screen with my avatar and confirms sign in like other games.

    I left my order of events as they are in my previous post above. I have App ID and Game ID and Client ID entered, so not sure if that makes a difference having all 3 entered. And I also signed the APK with both V1 and V2 this time, so not sure if that made the difference.

    I now have two remaining issues...

    1- Loading the player's best high score and saving as global variable to set in text field. It's always stuck at 0.

    2- And Display Leaderboards. When you click the icon to show leaderboard, a screen loads but the load circle just goes around and around.

    Still testing. So I'll report back if I get these to work.

    What exactly did you put for App ID, Game ID and Client ID?

  • I understand people are finding some of the new requirements a pain, I would like to say that I also find them pretty tedious. Just so everyone is clear:

    - APK files must be signed

    - You must supply your SHA-1 certificate signature in the Google Play Developer Console

    - The Google account you are testing with must be listed as a tester in the Google Play Developer Console

    If any of these are not done, when login is called it will briefly show the Play Games dialog, then it will vanish. These 3 things are required by Google (not by us), and any application that wants to use the Play Games service on Android must fulfil them.

    The reason why they were not previously required was because we used the Web API on all platforms, and the requirements are a lot slacker for the Web API. Unfortunately Google no longer allow you to use the web API within a WebView for security reasons.

    There are currently no known issues with the plugin. If you are experiencing a bug that isn't a sign in related configuration error then please open an issue on our bug tracker and I will look into it ASAP.

    Would it be possible to post a step by step guide (with images preferably) showing how to do all these (including Sign In/Out, Leaderboard etc.) Thank you!

  • > Hello! I did some modifications in my game, but only design related and when I tried to re-upload my game on Google Play I get this message "Your APK is using permissions that require a privacy policy: (android.permission.READ_PHONE_STATE)" Does anyone know why is this happening and how can I fix it? Do I really need to have a Privacy Policy? I export the game as unsigned .apk and sign it with the same key as I always do. Thank you!

    >

    The privacy policy is required because you have indicated your game is child appropriate. Without that indication, Google Play allows you to opt-out of the policy.

    But I just uploaded a new version of the .apk, without changing any configuration in the google play account (last one I uploaded worked just fine). So can "child appropriate" behavior be inferred from Construct 2 or what exactly do you mean?

Silviu's avatar

Silviu

Member since 5 Jul, 2016

None one is following Silviu yet!

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies