Help with Google Leaderboard via Crosswalk

Get help using Construct 2

Post » Sun Feb 22, 2015 2:40 pm

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
B
5
S
2
Posts: 122
Reputation: 868

Post » Sun Feb 22, 2015 4:06 pm

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:
Code: Select all
<!-- 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>


And then? What I should do in Construct2 environment? :(

Regards!
B
7
S
1
Posts: 21
Reputation: 581

Post » Sun Feb 22, 2015 4:20 pm

@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.
B
32
S
9
G
3
Posts: 205
Reputation: 7,794

Post » Sun Feb 22, 2015 7:22 pm

Now it works! I didn't find the plugin PhoneGapGame for Construct 2, only the crosswalk addition...

Thank you!
B
7
S
1
Posts: 21
Reputation: 581

Post » Sun Feb 22, 2015 8:15 pm

MACPK wrote:@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. :?
B
49
S
19
G
3
Posts: 588
Reputation: 6,209

Post » Sun Feb 22, 2015 8:53 pm

@kossglobal

for me it didn't work. And acually your app should have the right fingerprint if signed with debug key.
B
32
S
9
G
3
Posts: 205
Reputation: 7,794

Post » Mon Feb 23, 2015 1:26 am

@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?
B
7
S
1
Posts: 21
Reputation: 581

Post » Mon Feb 23, 2015 11:13 am

@MACPK
I've attached screenshot with my "code"

Image
B
7
S
1
Posts: 21
Reputation: 581

Post » Mon Feb 23, 2015 6:22 pm

@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 -

Image

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"

Code: Select all
<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>


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 :)
B
5
S
2
Posts: 122
Reputation: 868

Post » Mon Feb 23, 2015 6:28 pm

@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.
B
32
S
9
G
3
Posts: 205
Reputation: 7,794

Next

Return to How do I....?

Who is online

Users browsing this forum: Aluna, Google [Bot], Yahoo [Bot] and 6 guests