我正在尝试授权我的 Android 游戏使用 Google Play 服务,以便能够使用排行榜等。
现在当点击授权应用时,什么都不会发生。在信息页面上,谷歌告诉我做以下事情:
我将指定我的应用程序 ID,但是我从哪里得到这个“app_id”?还有成就id?排行榜 ID?
这个 ids.xml 应该是什么样子的?
有什么想法吗?
最佳答案
在“排行榜”或“成就”页面的底部有一个标记为“获取资源”的便捷链接。这将打开一个看起来像这样的页面:
<?xml version="1.0" encoding="utf-8"?>
<!--
Google Play game services IDs.
Save this file as res/values/games-ids.xml in your project.
-->
<resources>
<string name="app_id">00000000000</string>
<string name="achievement_xxx">0000000000</string>
<string name="achievement_yyy">0000000000</string>
<string name="leaderboard_xxx">000000000000</string>
</resources>
请注意,系统会指示您将其放入名称非法的文件“games-ids.xml”中。 Eclipse 不允许您在文件名中使用破折号,因此要么将其放入您的“strings.xml”文件中,要么按照您的计划使用“ids.xml”作为文件名,我发现两者都有效。
关于android - 授权 Android 游戏 - 应用程序 ID 在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22173316/