0 Favourites

Help with Google Leaderboard via Crosswalk

  • I need some advice with implementing leaderboard to my game. I've installed Cranberry plugin for leaderboards, and created the following event -

    Start of Layout, Browser: Is online, User is not logged in => Login User

    On touched button - Show Leaderboard

    (Credit to MACPK for the events, i read it on another post which i can't find now.)

    That's what i've done so far, i believe i have to get the App ID from Google Play and input that in the properties section of cranberrys plugin. Do i also need to input this after ticking Google Play Game services in the plugin section of Intel XDK?

    After that, what else would i need to do? I feel like i'm missing something but i'm not sure what it is, so i could do with some help on this.

    Thanks

  • Hi,

    I think we have a similar problem... but you're in advantage. Maybe between both of us we can solve this issue.

    Yesterday I opened another thread:

    viewtopic.php?f=147&t=125501

    So... we should use cranberrygame's plugin: https://github.com/cranberrygame/com.cr ... lugin.game

    Adding this in Intel XDK:

    <!-- caution: copy this to intelxdk.config.additions.xml and replace YOUR_GOOGLE_PLAY_GAME_APP_ID -->
    <intelxdk:plugin intelxdk:name="game" intelxdk:value="https://github.com/cranberrygame/com.cranberrygame.phonegap.plugin.game" intelxdk:id="com.cranberrygame.phonegap.plugin.game">
        <intelxdk:param intelxdk:name="APP_ID" intelxdk:value="YOUR_GOOGLE_PLAY_GAME_APP_ID" />
    </intelxdk:plugin>[/code:398m4bc4]
    
    And then? What I should do in Construct2 environment? <img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad">
    
    Regards!
  • tomhaiger

    PeYMaN57

    1. Cranberry Plugin added to C2

    2. Having C2 event: Start of Layout, Browser: Is online, User is not logged in => Login User

    3. Exported to InteXDK and replaced code with that shown above

    4. Your Google ID added to placeholder

    5. Exported as unsigned and signed with your key

    Should always work.

    • Please keep in mind that you have to link the service to your app so you need to upload e.g. an apk to alpha in google developer console.
    • Every time you update and export from c2 the code gets overwritten and you need to replace your ID again.
    • To test this you don't have to buld leaderboards and achievements. The google play games login should show up anyway.
  • Now it works! I didn't find the plugin PhoneGapGame for Construct 2, only the crosswalk addition...

    Thank you!

  • tomhaiger

    PeYMaN57

    1. Cranberry Plugin added to C2

    2. Having C2 event: Start of Layout, Browser: Is online, User is not logged in => Login User

    3. Exported to InteXDK and replaced code with that shown above

    4. Your Google ID added to placeholder

    5. Exported as unsigned and signed with your key

    Should always work.

    - Please keep in mind that you have to link the service to your app so you need to upload e.g. an apk to alpha in google developer console.

    - Every time you update and export from c2 the code gets overwritten and you need to replace your ID again.

    - To test this you don't have to buld leaderboards and achievements. The google play games login should show up anyway.

    I don't know why people keep saying to export as unsigned and sign with your key. It works in both ways.

  • kossglobal

    for me it didn't work. And acually your app should have the right fingerprint if signed with debug key.

  • MACPK

    I'm here again!

    Now, I've improved my game with Google Leaderboards but I have an issue.

    I've avoided to add Phonegap Game Login over Start Layout event because I want this action executes after touching an sprite.

    So... the first time I touch the sprite it works, but if I cancel the login and I try to touch again It doesn't work anymore...

    Any idea?

  • MACPK

    I've attached screenshot with my "code"

  • PeYMaN57 MACPK For some reason i can't get it to work for me, even after following the steps.

    I've installed Cranberry's plugin and i've set up my events as shown below -

    I've exported to IntelXDK and input the following code to intelxdl.config.additions.xml and added my App ID (11 digit number) instead of "YOUR_GOOGLE_PLAY_GAME_APP_ID"

    <intelxdk:plugin intelxdk:name="game" intelxdk:value="https://github.com/cranberrygame/com.cranberrygame.phonegap.plugin.game" intelxdk:id="com.cranberrygame.phonegap.plugin.game">
        <intelxdk:param intelxdk:name="APP_ID" intelxdk:value="YOUR_GOOGLE_PLAY_GAME_APP_ID" />
    </intelxdk:plugin>[/code:8bwqbkr0]
    
    Do i need i need to add my App ID to 'intelxdk:name="APP_ID"' as well? There was no mention of that, so i'm not sure.
    
    I haven't ticked Google Play services in the plugins section of IntelXDK and in the developer console, i've set up Play services and Alpha testing. Only thing i haven't done is set up achievements or leaderboards yet, but the whole thing is ready for testing.
    
    I'm assuming i've made a mistake somewhere so i'd appriciate some help
  • PeYMaN57

    Does it work when you restart the app? I can't really help you beacuase I think this it not a real user case.

    From my analytics more than 80% acccept it. If they don't I think they don't want to do later.

    My advice is to ignore that functionality. If you have more than 1000 active users per day you can start to analyse it and if it is a case having a deeper look into it. Concentrate on creating a nice game and a user/fan base first.

  • tomhaiger You don't haven to tick Google Play services in the plugins section of IntelXDK. This is the common plugin if you code everything by yourself. The code you add is the same like ticking a bock but Intel doesn't list the cranberry plugin and we need the modification of the ID. That is why it is a bit more complicated.

    Please prepare better screenshot if you have questions about this. I think here it is the wrong/missing input what you replaced with your ID.

    This is what I add to it and it works with more than 10 apps. I keep numbers (5s) in there to show how it has to look like. Please compare exact versions and lines of this. There are several versions of this snippet. For me only this one works:

    <intelxdk:plugin intelxdk:name="https://github.com/cranberrygame/com.cranberrygame.phonegap.plugin.game#544946ee7789ef539f7efe02ea6b12d03b1b8c62" intelxdk:value="https://github.com/cranberrygame/com.cranberrygame.phonegap.plugin.game#544946ee7789ef539f7efe02ea6b12d03b1b8c62" >
    	<intelxdk:param intelxdk:name='APP_ID' intelxdk:value='555555555555' />
        </intelxdk:plugin>[/code:14098l16]
  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • MACPK Thanks for the reply, that code is different to the one i'm using so i'll try that one.

    Is the event order in the screenshot OK? And everything else i mentioned with Google Play Services in the developer console?

    Edit: I've used the code but it's still not working for me, when I press my leaderboard button, nothing happens.

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