Problems with Google Play plugin

0 favourites
  • 6 posts
From the Asset Store
Google Analytics 4 Plugin for Construct 3 enables metrics and analytics for your games easily.
  • 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
  • I think the issue is probably that your using your package identifier for your game id. Game id is badly named, most of the time it will be the same as your application id. It should look like 12345678987. This will be preventing you from logging in, and the other methods will fail if your are not logged in.

    I've changed the name of it for the next release to "Application ID (android)" which will hopefully make it a little more obvious for people.

  • Also, try C3 r96, with a fix for high scores.

  • I think the issue is probably that your using your package identifier for your game id. Game id is badly named, most of the time it will be the same as your application id. It should look like 12345678987. This will be preventing you from logging in, and the other methods will fail if your are not logged in.

    I've changed the name of it for the next release to "Application ID (android)" which will hopefully make it a little more obvious for people.

    Thank you so much for this, now the automatic login seems to work. However the leaderboard is still not working. I tried to debug it a bit and I have 2 Text fields that should tell me if the submission and retrieval of score works. This is the code that I added:

    (Google Play) On score submit success -> (CheckLeaderboard) Set text to "Check Leaderboard: 1"

    (Google Play) On score submit fail -> (CheckLeaderboard) Set text to "Check Leaderboard: 0"

    (Google Play) On hi-score request success -> (CheckReceived) Set text to "Check Received: 1"

    (Google Play) On hi-score request fail -> (CheckReceived) Set text to "Check Received: 0"

    If my understanding of the Google Play object is correct, I should get a 1 if the score is sent to the leaderboard and if I receive it back when I click the button to do so (right?). I re-uploaded the game on Google Play with all these modifications, and when I click the button to submit the score or retrieve a hi-score, it actually puts a 1 in my text boxes, which I guess it means it is working. However, nothing shows inside the game (I expected to see an actual leaderboard list, with all the scores I submitted, in order). Also when I check the leaderboard in my Google Play console I can't find any score there. Do you know why this might be the case and how can I fix it? Thank you!

  • Have you exported using r96?

  • Have you exported using r96?

    When I open Construct 3, they tell me: "A new beta version of Construct 3 is available! You are using r94.2, and r96 is ready to use". I clicked Update and then import and open my project normally. Would this be enough for the update to take place? It is a bit weird however, as it asks me if I want to update every time I open Construct 3, so it seems like my choice doesn't get saved once I exit C3?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)