I don’t get a welcome back, I only get a log-in every time I open the application.
could Signing certificate fingerprint (SHA1) be a reason ? I entered random numbers
Yes, it’s very likely the reason. This is a very critical step that you have to get right. And you can’t change it. You have to create a new entry on Google Play.
I removed the app from the console, and I’m signing it again, but how do I get the Signing certificate fingerprint (SHA1) ?
how I’m supposed to get it ?
It’s all in the tutorial. http://coronalabs.com/blog/2013/06/25/tutorial-introducing-google-play-game-services/
Link your apps to the service following the six basic setup steps outlined below. Google provides a walkthrough on setting up your game here. IMPORTANT: make sure that you follow “c. Specify client ID settings“ — and particularly steps 2-5 — before you click on the “Create client” button.
finally leader showed up after uploading the application to the play store, thanks a lot mr.Rob
Good.
Are there any messages in your device’s console log?
there are only warnings saying : the game network provider <google> not available on the simulator. and another saying the library not available on this platform.
You can only test GPGS on a device. Your app in the simulator should not stop because of this. Can you copy/paste the exact messages you are getting? Post your build.settings as well.
Rob
yes, I’m talking about testing on my device, the app works fine in simulator.
build.settings :
[lua]settings = {
android = {
googlePlayGamesAppId = " 42229938906",
versionCode = “1”,
usesPermissions =
{
“android.permission.INTERNET”,
“android.permission.ACCESS_NETWORK_STATE”,
},
},
plugins = {
–[“CoronaProvider.ads.admob”] = { publisherId = “com.coronalabs” },
[“CoronaProvider.gameNetwork.google”] = { publisherId = “com.coronalabs”, supportedPlatforms = { android = true } },
},
orientation = {
default = “portrait”,
supported = { “portrait”, }
},[/lua]
messages :
warning : the game network provider <google> not available on the simulator
warning : the game network library not available on this platform
What device are you building for?
I’m building for android (galaxy note 3)
If that’s your complete build.settings you’re missing a closing } at the end.
Rob
Also see this line: googlePlayGamesAppId = " 42229938906",
There is a space between the " and the 4 that probably shouldn’t be there.
I fixed that and now the app doesn’t crash, but leaderboard does’t show ! and there’s no logging-in
I would suggest reading this tutorial: http://coronalabs.com/blog/2013/06/25/tutorial-introducing-google-play-game-services/
You’re missing setting up a call back listener in your .init() call so your login call has no place to return to so it can continue.
Rob
I came with this after the tutorial :
[lua]local gameNetwork = require “gameNetwork”
local leaderboardId = “CgkI2vXmqJ0BEAIQAA”
local playerName
local function loadLocalPlayerCallback( event )
playerName = event.data.alias
end
local function gameNetworkLoginCallback( event )
gameNetwork.request( “loadLocalPlayer”, { listener=loadLocalPlayerCallback } )
return true
end
local function gpgsInitCallback( event )
gameNetwork.request( “login”, { userInitiated=true, listener=gameNetworkLoginCallback } )
end
gameNetwork.init(“google”, gpgsInitCallback)
function scoreSubmit()
print(“SSUBMIT”)
end
local function submitScoreListener()
scoreSubmit()
gameNetwork.request(“setHighScore”, {localPlayerScore = {category = leaderboardId, value = 100}})
end
local storyboard = require (“storyboard”)
local btn = display.newText(“play1”, 0, 0, nil, 50)
btn.x=_W/2; btn.y=_H/2 - 30;
local btn2 = display.newText(“leaderboards”, 0, 0, nil, 50)
btn2.x=_W/2; btn2.y=_H/2+20;
local btn3 = display.newText(“submit”, 0, 0, nil, 50)
btn3.x=_W/2; btn3.y=_H/2+60;
function tbtn(e)
if e.phase == “ended” then
btn:removeSelf()
storyboard.gotoScene(“game2”)
end
end
function tbtn2(e)
if e.phase == “ended” then
gameNetwork.show(“leaderboards”)
end
end
function tbtn3(e)
if e.phase == “ended” then
submitScoreListener()
end
end
btn:addEventListener(“touch”, tbtn)
btn2:addEventListener(“touch”, tbtn2)
btn3:addEventListener(“touch”, tbtn3)[/lua]
is this how it sould be ?
I came with this after the tutorial :
[lua]local gameNetwork = require “gameNetwork”
local leaderboardId = “CgkI2vXmqJ0BEAIQAA”
local playerName
local function loadLocalPlayerCallback( event )
playerName = event.data.alias
end
local function gameNetworkLoginCallback( event )
gameNetwork.request( “loadLocalPlayer”, { listener=loadLocalPlayerCallback } )
return true
end
local function gpgsInitCallback( event )
gameNetwork.request( “login”, { userInitiated=true, listener=gameNetworkLoginCallback } )
end
gameNetwork.init(“google”, gpgsInitCallback)
function scoreSubmit()
print(“SSUBMIT”)
end
local function submitScoreListener()
scoreSubmit()
gameNetwork.request(“setHighScore”, {localPlayerScore = {category = leaderboardId, value = 100}})
end
local storyboard = require (“storyboard”)
local btn = display.newText(“play1”, 0, 0, nil, 50)
btn.x=_W/2; btn.y=_H/2 - 30;
local btn2 = display.newText(“leaderboards”, 0, 0, nil, 50)
btn2.x=_W/2; btn2.y=_H/2+20;
local btn3 = display.newText(“submit”, 0, 0, nil, 50)
btn3.x=_W/2; btn3.y=_H/2+60;
function tbtn(e)
if e.phase == “ended” then
btn:removeSelf()
storyboard.gotoScene(“game2”)
end
end
function tbtn2(e)
if e.phase == “ended” then
gameNetwork.show(“leaderboards”)
end
end
function tbtn3(e)
if e.phase == “ended” then
submitScoreListener()
end
end
btn:addEventListener(“touch”, tbtn)
btn2:addEventListener(“touch”, tbtn2)
btn3:addEventListener(“touch”, tbtn3)[/lua]
is this how it sould be ?
That’s closer. It’s really hard to read without the indents. But it looks like you’re calling gameNetwork.init() with a call back so it should start the chain reaction of the login process. You can put in some print statements to make sure you’re getting to where you need to go.
Rob