It’s my build.settings file:
settings = { orientation = { default = "portrait", supported = {"portrait","portraitUpsideDown"}, }, android = { usesPermissions = { "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.INTERNET", "com.android.vending.BILLING", "com.android.vending.CHECK\_LICENSE", }, googlePlayGamesAppId = "455502627444", isGame = true, minSdkVersion = "14", }, plugins = { ["CoronaProvider.native.popup.social"] = { publisherId = "com.coronalabs" }, ["plugin.google.play.services"] = { publisherId = "com.coronalabs" }, ["CoronaProvider.gameNetwork.google"] = { publisherId = "com.coronalabs", supportedPlatforms = {android = true} }, ["plugin.google.iap.v3"] = { publisherId = "com.coronalabs", supportedPlatforms = {android = true} }, }, }
And that’s my main.lua file:
local licensing = require("licensing") local gameNetwork = require("gameNetwork") local ads = require("ads") local composer = require("composer") licensing.init("google") local function licensinglistener(event) end licensing.verify(licensinglistener) local function loginlistener( event ) gameNetwork.request("login") end gameNetwork.init("google",loginlistener) ads.init("admob","ca-app-pub-6452739218858900/6016763275") composer.gotoScene("menu")
And now, the problem is I don’t know why but when I try use gameNetwork.show to show anything, I don’t see any effect. When I start application it’s logging me to Google Play, at least I think so. Here is how I try to show something:
local function googleplaylistener(event) local phase = event.phase if phase == "ended" then if settings.sounds then audio.play(buttonsound) end gameNetwork.show("achievements") end end googleplay:addEventListener("touch",googleplaylistener)
For achievements, and for leaderboards:
local function leaderboardslistener(event) local phase = event.phase if phase == "ended" then if settings.sounds then audio.play(buttonsound) end gameNetwork.show("leaderboards") end end leaderboards:addEventListener("touch",leaderboardslistener)
There is a problem with gameNetwork.request too. I have 50 achievements and 1 leaderboards. When I try to unlock achievement it’s simply not working. Here is the code:
if currentlevel == 1 then options.timers = 2 options.delay = {} options.delay[1] = 1000 options.delay[2] = 1250 options.tears = 10 options.time = 2500 options.achievement = "CgkI9ITK8KANEAIQAQ" elseif currentlevel == 2 then options.timers = 2 options.delay = {} options.delay[1] = 1000 options.delay[2] = 1250 options.tears = 20 options.time = 2500 options.achievement = "CgkI9ITK8KANEAIQAg"
gameNetwork.request("unlockAchievement",{achievement = {identifier = options.achievement}})