卡在尝试让游戏中心排行榜工作的过程中。

我试图让GameCenter排行榜运作,但卡住了。我在Xcode模拟器上测试,因为在设备上登录我们的沙盒帐户时遇到麻烦。我能够通过init函数登录游戏中的沙盒帐户,但排行榜在gamecenter中没有显示。在游戏下显示了我们的游戏,但在下面显示“没有排行榜或成就”。我已经在iTunes Connect中设置了排行榜,并在代码中发出了设置高分请求,似乎工作正常。以下是相关代码:

local function updateCallback(e)
    local data = json.encode( e.data )

    -- show encoded json string via native alert
    native.showAlert( "e.data", data, { "OK" } )
end

--[[
    Update the gamecenter learderboard for gamescore.
]]--
function [app name]GameNetwork.updateGamescore()
    --Sets the score if it is higher than the one on Apple's server
    gameNetwork.request( "setHighScore",
    {
        localPlayerScore = { category = "com.[domain].[game].gamescore", value = gamescore },
        listener = updateCallback
    })
end

正如预期的那样,当调用updateGamescore函数时,更新回调显示

{"value": 25,"category":"com.[domain].[game].gamescore"}

我有什么遗漏的吗?有关游戏网络API的任何好的教程吗?

在Corona论坛上的交叉贴文

点赞
用户2333874
用户2333874

最终找到了问题所在。问题出在应用程序ID上。我们的Ad Hoc配置文件有一个通配符,而我们的应用商店中没有这个通配符。我创建了一个具有特定应用程序ID的新的Ad Hoc配置文件,然后排行榜立即出现了。另外,我们的Ad Hoc配置文件使用的证书与应用商店证书不同,这也可能是问题所在。

2014-06-22 21:40:44