Okay so I may have deleted the API in my Google API Console and then the game services disappeared from my Dev Console BUT I undeleted it and everything has been restored(I had to remake the game services), but now it’s giving me the double sign-in error again using the Corona Sample and my app is giving a
“The gameNetwork is not available on this platform” message when attempting to show leaderboards/acheivements.
My app is not asking for sign-in with either debug or release key. Does “Target Store:” change anything? I tried both Google Play and “None” with no success.
I’m also getting a “WARNING: licensing.init() was already called for google.” error in the console.
Main.lua:
[lua]local licensing = require( “licensing” )
licensing.init( “google” )
local function licensingListener( event )
local verified = event.isVerified
if not event.isVerified then
–failed verify app from the play store, we print a message
–local alertBox = native.showAlert( “Notice”,
–“This app is not licensed!”,
–{“Purchase”, “Cancel”}, buyApp )
–native.requestExit() --assuming this is how we handle pirates
end
end
licensing.verify( licensingListener )
local function buyApp( event )
if “clicked” == event.action then
local i = event.index
if 1 == i then
system.openURL( “http://play.google.com/store/(ID)” )
elseif 2 == i then
– Close popup
end
end
end
–SETTINGS(internal)
– Hide Status Bar
display.setStatusBar(display.HiddenStatusBar)
– LIBRARIES – load global libraries that will be used throughout the app
local storyboard = require “storyboard”
storyboard.purgeOnSceneChange = true
–storyboard.isDebug = true
settings = require(“settings”)
settings.load()
– Scene Calls --go to’s
storyboard.gotoScene( ‘menu’ )[/lua]
Menu.lua:
[lua]local storyboard = require(“storyboard”)
local scene = storyboard.newScene()
local GGData = require( “GGData” )
coinbox = GGData:new(‘coins’)
coinbox:setSync( true )
local crypto = require( “crypto” )
coinbox:enableIntegrityControl( crypto.sha512, “” )
coinbox:updateAllIntegrityHashes()
local corruptEntries = coinbox:verifyIntegrity()
–print( corruptEntries ) – How many, if any, values were removed due to being different than expected.
local gameNetwork = require(“gameNetwork”)
local playerName
–DEFINE VARIABLES
local options
local mainMenu
local mrect1
local mrect2
local mrect3
local mrect4
local mrect5
local ox, oy = math.abs(display.screenOriginX), math.abs(display.screenOriginY)
–Functions
local levelSelect
local helpMenu
local appList
options =
{
effect = “crossFade”,
time = 1000
}
– Main Functions
–Game code
–(Note to self) X=Left/Right, Y=Up/Down | Left = -, Right = +, | Up = -, Down = +
levelSelect = function()
storyboard.gotoScene(‘levelselect’)
end
helpMenu = function()
storyboard.gotoScene(‘help’)
end
local function showLeaderboards( event )
–if ( system.getInfo(“platformName”) == “Android” ) then
gameNetwork.show( “leaderboards” )
–else
–gameNetwork.show( “leaderboards”, { leaderboard = {timeScope=“AllTime”} } )
– end
return true
end
local function showAchievements( event )
gameNetwork.show( “achievements” )
return true
end
function appRun()
if (settings.get(‘timesRun’)) == nil then
timesRun = 1
–print (“Saving Times Run “…timesRun…” to settings.json”)
settings.set(‘timesRun’, timesRun)
–print (" Times Run is:"…(settings.get(‘timesRun’))…" from settings.json")
GGData:set(‘coins’, 0)
coinbox:save()
else
end
end
delayListeners = function()
mrect1:addEventListener(‘touch’, levelSelect )
mrect2:addEventListener(‘touch’, helpMenu )
mrect3:addEventListener(‘touch’, appList )
mrect4:addEventListener(‘touch’, showAchievements )
mrect5:addEventListener(‘touch’, showLeaderboards )
end
– Scenes
– Called when the scene’s view does not exist:
function scene:createScene( event )
local group = self.view
mainMenu = display.newImage(‘images/mainmenu.png’)
mrect1 = display.newRect(30, 181, 94, 34)
mrect1.isVisible = false
mrect1.isHitTestable = true
mrect2 = display.newRect(30, 254, 96, 36)
mrect2.isVisible = false
mrect2.isHitTestable = true
mrect3 = display.newRect(13, 8, 129, 8)
mrect3.isVisible = false
mrect3.isHitTestable = true
mrect4 = display.newRect(31, 113, 111, 16)
mrect4.isVisible = true
mrect4.alpha = 0.5
mrect4.isHitTestable = true
mrect5 = display.newRect(175, 113, 111, 16)
mrect5.isVisible = true
mrect5.alpha = 0.5
mrect5.isHitTestable = true
group:insert(mrect1)
group:insert(mrect2)
group:insert(mrect3)
group:insert(mrect4)
group:insert(mrect5)
group:insert(mainMenu)
local Theme = audio.loadStream( “Title Screen Music.mp3” )
local Themeplay = audio.play( Theme, {loops=-1})
GGData:get(‘coins’)
end
– Called immediately after scene has moved onscreen:
function scene:enterScene( event )
local group = self.view
mrect1:addEventListener(‘touch’, levelSelect )
mrect2:addEventListener(‘touch’, helpMenu )
mrect3:addEventListener(‘touch’, appList )
mrect4:addEventListener(‘touch’, showAchievements )
mrect5:addEventListener(‘touch’, showLeaderboards )
–timer.performWithDelay(400, delayListeners)
appRun()
local function showCoins()
coinTxt = display.newText((coinbox.coins), 230, 5.5 - oy, “absender”, 15)
coinTxt.xScale = 5
coinTxt.yScale = 5
coinTxt.alpha = 0
coinTxt:setReferencePoint(display.CenterLeftReferencePoint)
group:insert(coinTxt)
transition.to(coinTxt, {alpha=1, xScale=1, yScale=1, delay=500})
end
timer.performWithDelay( 300, showCoins )
end
– Called when scene is about to move offscreen:
function scene:exitScene( event )
local group = self.view
Runtime:removeEventListener( “system”, systemEvents )
audio.stop()
end
– Called prior to the removal of scene’s “view” (display group)
function scene:destroyScene( event )
local group = self.view
audio.dispose( Theme )
Theme = nil
end
– Google Play Game Services Implementation
local function loadLocalPlayerCallback( event )
playerName = event.data.alias
–saveSettings() --save player data locally using your own “saveSettings()” function
end
local function gameNetworkLoginCallback( event )
gameNetwork.request( “loadLocalPlayer”, { listener=loadLocalPlayerCallback } )
return true
end
local function gpgsInitCallback( event )
gameNetwork.request( “login”, { userInitiated=true } )
print(‘Logging in…’)
end
local function gameNetworkSetup()
–if ( system.getInfo(“platformName”) == “Android” ) then
gameNetwork.init( “google”, gpgsInitCallback )
–else
– gameNetwork.init( “gamecenter”, gameNetworkLoginCallback )
–end
end
------HANDLE SYSTEM EVENTS------
local function systemEvents( event )
print("systemEvent " … event.type)
if ( event.type == “applicationStart” ) then
gameNetworkSetup() --login to the network here
end
return true
end
Runtime:addEventListener( “system”, systemEvents )
– Scene listeners
scene:addEventListener(“createScene”, scene)
scene:addEventListener(“enterScene”, scene)
scene:addEventListener(“exitScene”, scene)
scene:addEventListener(“destroyScene”, scene)
return scene[/lua]
I’ve also tried commenting out the licensing stuff to no avail… I’m not sure what else I can try.