Hello everyone i’m having problems implementing classifications on Android doesn’t work at all.
On IOS I Implement everything , but doesn’t show in lessem Board
Does Antonieta have an integration example?
Regards,
Miguel Lima
Hello everyone i’m having problems implementing classifications on Android doesn’t work at all.
On IOS I Implement everything , but doesn’t show in lessem Board
Does Antonieta have an integration example?
Regards,
Miguel Lima
To help you I am going to need a lot more help on this one. I am not sure I follow what you are trying to do. Can you explain?
THis is what i’m doing:
My (build.settings):
-- -- For more information on build.settings, see the Project Build Settings guide at: -- https://docs.coronalabs.com/guide/distribution/buildSettings -- settings = { orientation = { -- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight default = "portrait", supported = { "portrait", }, }, -- -- Android section -- android = { usesPermissions = { "android.permission.INTERNET", }, }, -- -- iOS section -- iphone = { xcassets = "Images.xcassets", plist = { NSAppTransportSecurity = { NSAllowsArbitraryLoads=true }, UIStatusBarHidden = false, UILaunchStoryboardName = "LaunchScreen", }, }, -- -- Plugins section -- plugins = { ["CoronaProvider.gameNetwork.apple"] = { publisherId = "com.coronalabs" }, ["plugin.googleAnalytics"] = { publisherId = "com.coronalabs" }, ["plugin.appnext"] = { publisherId = "com.appnext", }, ["plugin.fbAudienceNetwork"] = { publisherId = "com.coronalabs" }, ["plugin.iap\_badger"] = { publisherId = "uk.co.happymongoose", }, }, -- -- Project section -- excludeFiles = { -- Exclude unnecessary files for each platform all = { "Icon.png", "Icon-\*dpi.png", "Images.xcassets", }, android = { "LaunchScreen.storyboardc", }, }, }
My main.lua file:
local globalData = require( "globalData" ) local json = require( "json" ) globalData.gpgs = nil globalData.gameCenter = nil globalData.gameCenter = require( "gameNetwork" ) -- Apple Game Center initialization/login listener local function gcInitListener( event ) if event.data then -- Successful login event print( json.prettify(event) ) end end globalData.gameCenter.init( "gamecenter", gcInitListener )
Then in menu i need to display the leaderboard when they press the tanking button(menu.lua:
local gameNetwork = require( "gameNetwork" ) local loggedIntoGC = false local function initCallback( event ) if ( event.type == "showSignIn" ) then -- This is an opportunity to pause your game or do other things you might need to do while the Game Center Sign-In controller is up. elseif ( event.data ) then loggedIntoGC = true native.showAlert( "Success!", "", { "OK" } ) end end local function onSystemEvent( event ) if ( event.type == "applicationStart" ) then gameNetwork.init( "gamecenter", initCallback ) return true end end Runtime:addEventListener( "system", onSystemEvent )
Then i call when they input the button(menu.lua):
local function podioFunction(event) gameNetwork.request( "loadScores", { leaderboard = { category = "highScore", playerScope = "Global", -- "Global" or "FriendsOnly" timeScope = "AllTime", -- "AllTime", "Week", or "Today" range = { 1,25 } }, listener = requestCallback } ) gameNetwork.show( "leaderboards", { leaderboard = { category = "highScore" }, listener = showLeaders } ) end podioGroup:addEventListener("tap", podioFunction)
Then i my game over Scene i summit the score (gameOver.lua):
------------------Game Center Settings---------------- local globalData = require( "globalData" ) local json = require( "json" ) globalData.gpgs = nil globalData.gameCenter = nil globalData.gameCenter = require( "gameNetwork" ) -- Apple Game Center initialization/login listener local function gcInitListener( event ) if event.data then -- Successful login event print( json.prettify(event) ) end end globalData.gameCenter.init( "gamecenter", gcInitListener ) local function submitScoreListener( event ) -- Google Play Games Services score submission if ( globalData.gpgs ) then if not event.isError then local isBest = nil if ( event.scores["daily"].isNewBest ) then isBest = "a daily" elseif ( event.scores["weekly"].isNewBest ) then isBest = "a weekly" elseif ( event.scores["all time"].isNewBest ) then isBest = "an all time" end if isBest then -- Congratulate player on a high score local message = "You set " .. isBest .. " high score!" native.showAlert( "Congratulations", message, { "OK" } ) else -- Encourage the player to do better native.showAlert( "Sorry...", "Better luck next time!", { "OK" } ) end end -- Apple Game Center score submission elseif ( globalData.gameCenter ) then if ( event.type == "setHighScore" ) then -- Congratulate player on a high score native.showAlert( "Congratulations", "You set a high score!", { "OK" } ) else -- Encourage the player to do better native.showAlert( "Sorry...", "Better luck next time!", { "OK" } ) end end end local function submitScore( score ) if ( globalData.gpgs ) then -- Submit a score to Google Play Games Services globalData.gpgs.leaderboards.submit( { leaderboardId = "CgkA8kb12jK0onOQBg", score = score, listener = submitScoreListener }) elseif ( globalData.gameCenter ) then -- Submit a score to Apple Game Center globalData.gameCenter.request( "setHighScore", { localPlayerScore = { category = "highScore", value = score }, listener = submitScoreListener }) end end
My (globaData.lua):
local M = {} return M
@agramonte Thanks for you are dispose to help me, i appreciate a lot.
It looks like you didn’t implement licensing. Need to follow the directions here:
https://docs.coronalabs.com/api/library/licensing/index.html
Once you call init on the license you don’t really need to do anything else.
Edit:
As a side note, I would stop using Appnext the plugin will stop showing ads in 4 days.
To help you I am going to need a lot more help on this one. I am not sure I follow what you are trying to do. Can you explain?
THis is what i’m doing:
My (build.settings):
-- -- For more information on build.settings, see the Project Build Settings guide at: -- https://docs.coronalabs.com/guide/distribution/buildSettings -- settings = { orientation = { -- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight default = "portrait", supported = { "portrait", }, }, -- -- Android section -- android = { usesPermissions = { "android.permission.INTERNET", }, }, -- -- iOS section -- iphone = { xcassets = "Images.xcassets", plist = { NSAppTransportSecurity = { NSAllowsArbitraryLoads=true }, UIStatusBarHidden = false, UILaunchStoryboardName = "LaunchScreen", }, }, -- -- Plugins section -- plugins = { ["CoronaProvider.gameNetwork.apple"] = { publisherId = "com.coronalabs" }, ["plugin.googleAnalytics"] = { publisherId = "com.coronalabs" }, ["plugin.appnext"] = { publisherId = "com.appnext", }, ["plugin.fbAudienceNetwork"] = { publisherId = "com.coronalabs" }, ["plugin.iap\_badger"] = { publisherId = "uk.co.happymongoose", }, }, -- -- Project section -- excludeFiles = { -- Exclude unnecessary files for each platform all = { "Icon.png", "Icon-\*dpi.png", "Images.xcassets", }, android = { "LaunchScreen.storyboardc", }, }, }
My main.lua file:
local globalData = require( "globalData" ) local json = require( "json" ) globalData.gpgs = nil globalData.gameCenter = nil globalData.gameCenter = require( "gameNetwork" ) -- Apple Game Center initialization/login listener local function gcInitListener( event ) if event.data then -- Successful login event print( json.prettify(event) ) end end globalData.gameCenter.init( "gamecenter", gcInitListener )
Then in menu i need to display the leaderboard when they press the tanking button(menu.lua:
local gameNetwork = require( "gameNetwork" ) local loggedIntoGC = false local function initCallback( event ) if ( event.type == "showSignIn" ) then -- This is an opportunity to pause your game or do other things you might need to do while the Game Center Sign-In controller is up. elseif ( event.data ) then loggedIntoGC = true native.showAlert( "Success!", "", { "OK" } ) end end local function onSystemEvent( event ) if ( event.type == "applicationStart" ) then gameNetwork.init( "gamecenter", initCallback ) return true end end Runtime:addEventListener( "system", onSystemEvent )
Then i call when they input the button(menu.lua):
local function podioFunction(event) gameNetwork.request( "loadScores", { leaderboard = { category = "highScore", playerScope = "Global", -- "Global" or "FriendsOnly" timeScope = "AllTime", -- "AllTime", "Week", or "Today" range = { 1,25 } }, listener = requestCallback } ) gameNetwork.show( "leaderboards", { leaderboard = { category = "highScore" }, listener = showLeaders } ) end podioGroup:addEventListener("tap", podioFunction)
Then i my game over Scene i summit the score (gameOver.lua):
------------------Game Center Settings---------------- local globalData = require( "globalData" ) local json = require( "json" ) globalData.gpgs = nil globalData.gameCenter = nil globalData.gameCenter = require( "gameNetwork" ) -- Apple Game Center initialization/login listener local function gcInitListener( event ) if event.data then -- Successful login event print( json.prettify(event) ) end end globalData.gameCenter.init( "gamecenter", gcInitListener ) local function submitScoreListener( event ) -- Google Play Games Services score submission if ( globalData.gpgs ) then if not event.isError then local isBest = nil if ( event.scores["daily"].isNewBest ) then isBest = "a daily" elseif ( event.scores["weekly"].isNewBest ) then isBest = "a weekly" elseif ( event.scores["all time"].isNewBest ) then isBest = "an all time" end if isBest then -- Congratulate player on a high score local message = "You set " .. isBest .. " high score!" native.showAlert( "Congratulations", message, { "OK" } ) else -- Encourage the player to do better native.showAlert( "Sorry...", "Better luck next time!", { "OK" } ) end end -- Apple Game Center score submission elseif ( globalData.gameCenter ) then if ( event.type == "setHighScore" ) then -- Congratulate player on a high score native.showAlert( "Congratulations", "You set a high score!", { "OK" } ) else -- Encourage the player to do better native.showAlert( "Sorry...", "Better luck next time!", { "OK" } ) end end end local function submitScore( score ) if ( globalData.gpgs ) then -- Submit a score to Google Play Games Services globalData.gpgs.leaderboards.submit( { leaderboardId = "CgkA8kb12jK0onOQBg", score = score, listener = submitScoreListener }) elseif ( globalData.gameCenter ) then -- Submit a score to Apple Game Center globalData.gameCenter.request( "setHighScore", { localPlayerScore = { category = "highScore", value = score }, listener = submitScoreListener }) end end
My (globaData.lua):
local M = {} return M
@agramonte Thanks for you are dispose to help me, i appreciate a lot.
It looks like you didn’t implement licensing. Need to follow the directions here:
https://docs.coronalabs.com/api/library/licensing/index.html
Once you call init on the license you don’t really need to do anything else.
Edit:
As a side note, I would stop using Appnext the plugin will stop showing ads in 4 days.