I am having an issue where My android app initiates the google play game services log in box but after a few seconds it disappears and the game continues to load. I dont see any other notification that I logged in successfully. Why is this happening? On iOS the same code is logging in fine.
I have gone through the correct setup process of creating Keystores, signing the app with SHA1 and linking them.
Build.Settings
settings = { plugins = { ["CoronaProvider.gameNetwork.google"] = { publisherId = "com.coronalabs", supportedPlatforms = { android = true }, }, ["CoronaProvider.gameNetwork.apple"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, ["iphone-sim"]=true }, }, }, android = { googlePlayGamesAppId = "XXXXXXXXXXXX", usesPermissions = { "android.permission.INTERNET", "android.permission.WRITE\_EXTERNAL\_STORAGE", "android.permission.ACCESS\_WIFI\_STATE", "android.permission.ACCESS\_NETWORK\_STATE", }, } }
globals.lua
M.highscore = 0 M.platform = "iOS" M.leaderboard = "Score" if system.getInfo("platformName") == "Android" then M.platform = "Android" M.leaderboard = "my leader code here" end
scoring.lua
local M = {} local gameNetwork = require "gameNetwork" local utils = require("helpers.globals") local loggedIntoGC = false -- Start off by loggin the user into Gamecenter or GPGC local function initCallback( event ) if utils.platform == "Android" then local function loginListener() loggedIntoGC = true end if not event.isError then gameNetwork.request( "login", { userInitiated=true, listener=loginListener } ) end else if event.data then loggedIntoGC = true else loggedIntoGC = false end end end local function onSystemEvent( event ) if event.type == "applicationStart" or event.type == "applicationResume" then if utils.platform == "Android" then gameNetwork.init( "google", initCallback ) else gameNetwork.init( "gamecenter", initCallback ) end return true end end Runtime:addEventListener( "system", onSystemEvent ) onSystemEvent( {type="applicationStart"} )