How do I Retrieve Hi Score from Google Play Services

Get help using Construct 2

Post » Mon Apr 25, 2016 4:12 pm

I'm having decent success with Google Play Services. Everything seems to work, login, and submit score triggers success.
Everything seems to work smoothly. The only thing I'm having trouble with is retrieving the score.

FYI -- I am in the testing phase not even to mobile yet. Strictly on the web.

Googleplay.HiScoreMyBest keeps showing as zero, even though submit score works and triggers submit score success.

Please help! I feel like I'm so close. I have turned off tampering on the dashboard. Tried many things. Am I simply not accessing the correct variable after Request player details?

If your suggestion is to use the Cranberry plugin will that work for web? Thank you.
B
31
S
5
G
2
Posts: 42
Reputation: 2,569

Post » Mon Apr 25, 2016 8:45 pm

I will answer my own question here in case anyone else has the same issue. I didn't need a plugin. I needed to request scores from the leaderboard first.

Where I got tripped up was I thought I could request player details and the person's best score (GooglePlay.HiScoreMyBest) would be available. No. Request the appropriate leader board (I recommend using "social" and "window" among the options) then it's available.

Thanks all! The Construct 2 community is superb, so I hope this helps! Cheers!
B
31
S
5
G
2
Posts: 42
Reputation: 2,569

Post » Tue Apr 26, 2016 6:18 am

Hi my problem is I don't know how to use google play services construct 2 inbuilt plugin
i have done something with following manual
but I did not understand how to use google developer console for preview in mobile or desktop
.
I think you have done this already so can you help me for doing this step
you can help with short commands like
go her >> click that >> do this >> do that etc
pls help
Image
B
67
S
40
G
48
Posts: 680
Reputation: 34,041

Post » Tue Apr 26, 2016 10:24 am

The best I can say is follow the directions step by step very carefully here:
https://www.scirra.com/manual/175/google-play
Especially the part about enabling access in preview mode, copy & pasted below.


Enabling access in preview mode
When testing your project, your game will typically run from localhost or a local IP address for preview-over-wifi. Since this is is different to the published URL of your game, Google Play Game Services will block access unless you add the preview URLs as permitted locations.

To do this, in the Developer Console under Game details, find the header that says API CONSOLE PROJECT and follow the link to the API console project for your game. In the API console, select APIs & auth, then Credentials. Notice the Javascript Origins field contains only your final URL; this also needs to contain any preview URLs to be allowed access. Click Edit settings. Under Authorized Javascript Origins, make sure the final URL and any preview URLs appear on separate lines. Note normal preview by default happens on http://localhost:50000, but you also need to add any preview-over-wifi addresses you use, such as http://192.168.1.3:50000. For example, the completed Authorized Javascript origins could list:

http://www.mywebsite.com/games/myawesomegame
http://localhost:50000
http://192.168.1.3:50000

Click Update. Now your game should be authorised to be accessed from preview mode as well as when you publish it.
B
31
S
5
G
2
Posts: 42
Reputation: 2,569


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests