android - 如何知道 android 购买数据是否为沙盒(是否测试)?

标签 android in-app-purchase sandbox android-inapp-purchase

我们已经在应用程序购买中实现了 android,我们正在将购买信息发送到我们的后端,我的问题是如何知道购买数据是否是沙盒?在谷歌更新测试 env 订单 ID 之前testing 是 null ,现在 google 是返回和订单 id 用于测试 env, 有一个来自谷歌的文档用于成功响应数据 https://developer.android.com/google/play/billing/billing_reference.html

但是没有任何值表明我们在测试env

最佳答案

您无法区分。

“沙盒”购买是为了模拟真实购买。你无法通过 Intent 来区分它们(在代码中,你可以通过你没有从中获得任何金钱来区分,但应用程序无法区分)

Google Play 和那里的后端(处理实际的购买流程,您无法控制)显然知道。但不会向应用程序发送任何信息来说明它是否是沙盒购买

关于android - 如何知道 android 购买数据是否为沙盒(是否测试)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47960547/

相关文章:

java - 无法在 Android 上使用 HttpURLConnection 将数据发布到站点

ios - Apple - 应用内购买 : How to make sure the user is authorised to use Free trial subscription only one time?

ios - 用户可以修改 iOS 应用程序中的 NSUserDefaults 键值吗?

ios - 应用内购买服务器模型,交易相关

sandbox - 有没有办法重置我的 GameCenter 沙盒帐户的成就进度?

java - 为什么我的 View 数组返回 null?

android - 可能使用 javacv/ffmpeg 将 h264 流式传输到 javafx

java - 表 "places"没有名为 "smallDesc"的列

objective-c - 全局事件、Mac App Store 和沙盒

Paypal IPN 验证 - 尽管已到达成功页面但仍不起作用