Version: 2022.1
Implementing IAP products
在 UDP 控制台上管理和发布游戏

在 UDP 沙盒中测试游戏

在首次发布游戏并为应用商店重新打包游戏之前,请在沙盒环境中测试游戏。必须执行以下操作:

  • 在沙盒中至少初始化一次 UDP(适用于所有游戏)
    • 调用 Initialize() 方法
  • 至少在沙盒中完成一次 IAP 购买(如果游戏具有 IAP)
    • 调用 Purchase() 方法

This is to ensure that the UDP implementation works for a simple and nominal case. Unity recommends you test your UDP methods more extensively. After your first release, you do not need to retest in the sandbox to release new revisions of your game on UDP.

Note: If you test your game in the Unity Editor Play mode, all IAP transactions are successful and are automatically consumed. This is not connected to the UDP console and is not sufficient to clear sandbox testing.

要在沙盒中测试游戏,请执行以下操作:

  1. In the Unity Distribution Portal tab of the Project Settings window, go to the UDP Sandbox Test accounts section and create login credentials for the sandbox environment.
    If you have already added credentials in the UDP console, you can use those. 1.在 Android 设备或模拟器上运行游戏。
    游戏启动时,应调用 Initialize 方法,该方法会在沙盒环境中自动显示登录屏幕。如果没有在游戏启动时调用 Initialize,请触发必要的步骤来调用 Initialize。 1.输入沙盒测试帐户的登录凭据。
    这就是检查游戏是否初始化所需的全部步骤。 1.对于 IAP 游戏,进行购买以测试 IAP 购买。
    在沙盒环境中不会进行任何实际交易。

每次测试成功后:

  • 沙盒环境显示弹窗通知
  • UDP 沙盒将更新 UDP 控制台的“沙盒测试”部分,以显示对应测试的绿色已测试状态

成功完成所有必需的测试后,“游戏信息”页面的左侧面板会显示一个绿色的勾号,以确认已通过沙盒测试。现在,你可以完成“游戏信息”页面上的所有剩余步骤,以发布你的第一个修订版并将其提交到商店。

沙盒登录凭据仅适用于沙盒环境的通用 UDP 构建版本。当 UDP 重新打包用于实际应用商店的构建版本时,UDP 会移除沙盒环境和登录页面,并在特定于商店的 SDK 中打补丁。构建版本中特定于商店的 SDK 可确保 IAP 交易采用该商店的付款系统。

注意:沙盒模式还支持服务器端验证。

故障排除

如果出现与 IAP 相关的任何问题,请检查 UDP 和/或 IAP 实现,例如以下问题:

  • 不显示登录屏幕
  • 检索不到 IAP 商品
  • 购买按钮不响应
  • 无法完成购买

For further troubleshooting information, check the UDP Package documentation or contact the UDP support team via the “Contact Support” link on the UDP Console.

Implementing IAP products
在 UDP 控制台上管理和发布游戏
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961