google achievements

Hi

I bought an google account developer, i did achievements for my game but nothing doesen’t works, i tried with release keystore too!..i did this in main.lua

[lua]

local gameNetwork = require “gameNetwork”

gameNetwork.init(“google”)

gameNetwork.request(“login”,

{

    userInitiated = false

})

 function unlockAchievementListener(event)

    gameNetwork.request(“unlockAchievement”,

        {

            achievement = 

            {

                identifier = “xxxxxxxxxxxx”

            }

        })

end
[/lua]

and in level1.lua in scene:show and phase==“will”

[lua]

unlockAchievementListener()

[/lua]

Please help me!!

Do you have all the required stuff in your build.settings?

yes i think…
[lua]

plugins =

    {

        [“plugin.google.play.services”] =

        {

            publisherId = “com.coronalabs”

        },

        [“CoronaProvider.gameNetwork.google”] =

        {

            publisherId = “com.coronalabs”,

            supportedPlatforms = { android=true },

        },

    },

android =

{

googlePlayGamesAppId = “xxxxxxxxxx”,

usesPermissions =

{

“android.permission.INTERNET”,

},

},

[/lua]

I wonder if first line in your main.lua is the problem.  You are declaring gameNetwork as local and and it might be a scope issue once main.lua is finished.  You can try to make that global.

At this point, I would declare a listener, and then see what is returned.  If there is a problem, then isError would be true, and you can check what’s going on.  If testing on a device, use adb and dump logs to your computer.

I tried with global gameNetwork…but doesn’t work…

Unless I am just not seeing the obvious, at this point I would connect your device to your computer and dump the output via adb to see if your code is generating any errors.

Do you have all the required stuff in your build.settings?

yes i think…
[lua]

plugins =

    {

        [“plugin.google.play.services”] =

        {

            publisherId = “com.coronalabs”

        },

        [“CoronaProvider.gameNetwork.google”] =

        {

            publisherId = “com.coronalabs”,

            supportedPlatforms = { android=true },

        },

    },

android =

{

googlePlayGamesAppId = “xxxxxxxxxx”,

usesPermissions =

{

“android.permission.INTERNET”,

},

},

[/lua]

I wonder if first line in your main.lua is the problem.  You are declaring gameNetwork as local and and it might be a scope issue once main.lua is finished.  You can try to make that global.

At this point, I would declare a listener, and then see what is returned.  If there is a problem, then isError would be true, and you can check what’s going on.  If testing on a device, use adb and dump logs to your computer.

I tried with global gameNetwork…but doesn’t work…

Unless I am just not seeing the obvious, at this point I would connect your device to your computer and dump the output via adb to see if your code is generating any errors.