Hi,
For the last days I am trying to work out the leaderboard on my android device.
The problem is that the login is failed. (The gameNetwork.request( “isConnected”) return False and also isErro return True )
Note that the game was publish in Alpha test and all other functionality working well - Including in-App products.
Also the leaderboard was working for me for a while until it stops to work - don’t know why.
This is the code in main.lua
local function gameNetworkLoginCallback( event ) print ("gameNetwork.request( isConnected):",gameNetwork.request( "isConnected") ) --This print false for k,v in pairs( event ) do print( k,v ) -- This print isError = true end end local function gpgsInitCallback( event ) if not event.isError then print ("222 gpgsInitCallback======================================================" ) gameNetwork.request( "login", { userInitiated=true, listener=gameNetworkLoginCallback } ) else native.showAlert( "Failed!", "NOT able to connect to Google Play.\n Error: ".. event.errorM essage.."\nErrorCode: "..event.errorCode, { "OK" } ) end end -- Login to GPGC gameNetwork.init( "google", gpgsInitCallback )
Part of Build.setting
android =
{
googlePlayGamesAppId = “624348083571”,
allowAppsReadOnlyAccessToFiles = false,
versionCode = “12”,
usesPermissions =
{
“android.permission.INTERNET”,
“android.permission.WRITE_EXTERNAL_STORAGE”,
“com.android.vending.BILLING”
},
usesFeatures =
{
{ name = “android.hardware.camera”, required = false },
{ name = “android.hardware.location”, required = false },
{ name = “android.hardware.location.gps”, required = false }
}
},
config.lua
local aspectRatio = display.pixelHeight / display.pixelWidth
application =
{
content =
{
width = 320, --Default to Iphone 5 Scale (Original 640 * 1136)
height = 568 ,
scale = “zoomStretch”,
xAlign =“left”,
yAlign = “top”,
imageSuffix =
{
– Iphone 4,5,6 - Low. Iphone 6+ - High
["@2x"] = 2.5 – from screen width 800 (=320*2.5) and above will consider as high res
},
fps = 60
},
license =
{
google =
{
--key = “624348083111”,
key = “MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwmED0Wse1yaOLXSQEjbVQF+clWfYt63ys2jHv2lq3+WIJOOGXy7qNCoKOEge257nSlFX/4J9G54Q4tIoBYtTqsx1AjBIpM2BQ1t7RZAllj+4qs4vz/JGo5i93JOfAENheChQuAPC5ckZuAoyNEQumSlK6DTJi8ZHmYadFHuopxzefzWJl2MeGbQpPXky1SxBTdW2uHY2b7/yWuLk1XdWlqVc7KvDUZ8kPj573SJUTZrfinGZgHqaxzYbUG9BurIDh1fBglUYSSMxWN1aSyONmIzrI3DYeeu9nvE4jILgq9PL4wgSHt5tHjYKkD7KqbX7pGxdhvsJWYin0BbofC6x9QIDAAAA”,
},
},
}
