gpt4 book ai didi

ios - 试图让 Game Center Leaderboard 正常工作

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:36:05 29 4
gpt4 key购买 nike

我正在尝试让 gamecenter 排行榜正常工作,但卡住了。我正在 Xcode 模拟器上进行测试,因为我无法在设备上登录我们的沙箱帐户。我可以使用 init 函数通过游戏登录沙盒帐户,但排行榜不会显示在 gamecenter 中。在游戏下方,它显示我们的游戏,但在下方显示“没有排行榜或成就”。我已经在 itunes connect 中设置了一个排行榜,并且在代码中请求 setHighScore 似乎有效。相关代码如下:

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

正如预期的那样,更新回调显示

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

updateGamescore 函数被调用时。我错过了什么吗?关于 gamenetwork api 有什么好的教程吗?

Cross-post from corona forum

最佳答案

终于明白了。问题出在应用程序 ID 上。我们的临时配置文件有一个通配符,而我们的应用程序商店没有。我使用特定的应用程序 ID 创建了一个新的临时配置文件,排行榜立即出现。此外,我们的临时配置文件使用的证书与应用商店证书不同,因此这也可能是问题所在。

关于ios - 试图让 Game Center Leaderboard 正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22122219/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com