Leader Board Log In

hey guys the last time i was on the forums had a little problem with my leader board system, i went on to solving that problem. Now i have another problem some times my leader board gives me the welcome … on in the main screen, and some time it didn’t. so this lead me to think my leader board system is not logging properly. i have follow the step correctly to create my SHA1 finger print correctly and and setting up my lua  callings, so i don’t know why i am getting this error of failed to log in to leader board.  Here’s my build settings and code 

-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight -- build settings settings = { orientation = { default = "landscapeRight", supported = { "landscapeRight", } }, iphone = { plist = { CFBundleIconFile = "Icon.png", CFBundleIconFiles = { "Icon.png" , "Icon@2x.png" , "Icon-72.png", "Icon-xxhdpi.png", "Icon-hdpi.png" }, UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend --[[-- iOS app URL schemes: CFBundleURLTypes = { { CFBundleURLSchemes = { "fbXXXXXXXXXXXXXX", -- example scheme for facebook "coronasdkapp", -- example second scheme } } } --]] } }, -- Android permissions androidPermissions = { "android.permission.INTERNET", }, android = { googlePlayGamesAppId = "1093344193242" --long App ID number (use yours!) }, plugins = { ["CoronaProvider.gameNetwork.google"] = { publisherId = "com.coronalabs", }, }, }

and my code …

local gameNetwork = require "gameNetwork" local init; function initCallback( event ) if not event.isError then init = true print("initCallback success"); else init = false print("initCallback failed", event.errorMessage); end end function requestCallback(isError) if (isError) then print("login failed") else print("login success") end end print( "Calling gameNetwork.init") gameNetwork.init( "google", initCallback ) print("Calling login") gameNetwork.request( "login", { userInitiated = true, listener = requestCallback }) print("calling leaderboards") gameNetwork.show( "leaderboards" ) print("calling achievements") gameNetwork.show( "achievements" )

and i went ahead and use the ADB manager and it say… 

V/Corona ( 6127): \> Class.forName: network.LuaLoader V/Corona ( 6127): \< Class.forName: network.LuaLoader V/Corona ( 6127): Loading via reflection: network.LuaLoader V/Corona ( 6127): \> Class.forName: CoronaProvider.licensing.google.LuaLoader V/Corona ( 6127): \< Class.forName: CoronaProvider.licensing.google.LuaLoader V/Corona ( 6127): Loading via reflection: CoronaProvider.licensing.google.LuaLo ader V/Corona ( 6127): WARNING: Asset file "start background01@2x.png" does not exis t. I/Corona ( 6127): Calling gameNetwork.init V/Corona ( 6127): \> Class.forName: CoronaProvider.gameNetwork.google.LuaLoader V/Corona ( 6127): \< Class.forName: CoronaProvider.gameNetwork.google.LuaLoader V/Corona ( 6127): Loading via reflection: CoronaProvider.gameNetwork.google.Lua Loader I/Corona ( 6127): Calling login I/Corona ( 6127): calling leaderboards I/Corona ( 6127): calling achievements I/Corona ( 6127): initCallback success I/Corona ( 6127): login failed -- my error C:\Users\sean\android projects\andoid sdk\sdk\platform-tools\>

so what could be my  problem ?   Also my  leader board package name and app package name match each other.   i Also use this blog as a guide https://coronalabs.com/blog/2013/06/25/tutorial-introducing-google-play-game-services/.  

Thanks for your Help :}] :) PS i am using the google leader board system

Can Some one Help Please >> :slight_smile:

Are you logged in to your device’s Google Play app?

I am logged and I don’t see my app in
The Google play app also all this code is in my main.lua file

Hey Rob i figure out my problem and now its logging in correctly but the score won’t submit to the sever  

local gameNetwork = require("gameNetwork") function gameOver() print " sumit" --score.save() --checkUp() scoreSubmit() storyboard.gotoScene("restart", "fade", 400) end function scoreSubmit( event ) print "scoreSubmited" local myScore = 100 --for GameCenter, default to the leaderboard name from iTunes Connect local myCategory = "com.yourname.yourgame.highscores" if ( system.getInfo( "platformName" ) == "Android" ) then --for GPGS, reset "myCategory" to the string provided from the leaderboard setup in Google myCategory = "CgkI2tWRg-kfEAIQBg" end gameNetwork.request( "setHighScore", { localPlayerScore = { category=myCategory, value=tonumber(myScore) }, listener = postScoreSubmit } ) end &nbsp;

here how i set up the code thanks for your help 

Do you have a function to handle the listener you defined as “postScoreSubmit”?  If so what results are being passed to that function?  Are you looking at your console log on your device to see if there are any errors coming from Google Play?  Remember if you use adb logcat like this:

adb logcat Corona:v \*:s

then you are only getting messages generated by your app.  To see the Google Play errors, leave off the Corona:v *:s bits.

Rob

Rob I just figure the problem again a value inside of the Google developer consol had a wrong input, which was my error. The box that said don’t allow scores above this was set to zero so it didn’t allow any score I was trying to submit. Thanks many man your help I appreciate it.

Can Some one Help Please >> :slight_smile:

Are you logged in to your device’s Google Play app?

I am logged and I don’t see my app in
The Google play app also all this code is in my main.lua file

Hey Rob i figure out my problem and now its logging in correctly but the score won’t submit to the sever  

local gameNetwork = require("gameNetwork") function gameOver() print " sumit" --score.save() --checkUp() scoreSubmit() storyboard.gotoScene("restart", "fade", 400) end function scoreSubmit( event ) print "scoreSubmited" local myScore = 100 --for GameCenter, default to the leaderboard name from iTunes Connect local myCategory = "com.yourname.yourgame.highscores" if ( system.getInfo( "platformName" ) == "Android" ) then --for GPGS, reset "myCategory" to the string provided from the leaderboard setup in Google myCategory = "CgkI2tWRg-kfEAIQBg" end gameNetwork.request( "setHighScore", { localPlayerScore = { category=myCategory, value=tonumber(myScore) }, listener = postScoreSubmit } ) end &nbsp;

here how i set up the code thanks for your help 

Do you have a function to handle the listener you defined as “postScoreSubmit”?  If so what results are being passed to that function?  Are you looking at your console log on your device to see if there are any errors coming from Google Play?  Remember if you use adb logcat like this:

adb logcat Corona:v \*:s

then you are only getting messages generated by your app.  To see the Google Play errors, leave off the Corona:v *:s bits.

Rob

Rob I just figure the problem again a value inside of the Google developer consol had a wrong input, which was my error. The box that said don’t allow scores above this was set to zero so it didn’t allow any score I was trying to submit. Thanks many man your help I appreciate it.