检测当前订阅是否为 Google Play 商店的试用版? [英] Detecting whether the current subscription is in Trial for Google Play store?

查看:29
本文介绍了检测当前订阅是否为 Google Play 商店的试用版?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试检测通过应用内购买购买我的应用的用户当前是否处于试用期.

I'm trying to detect whether a user who has purchased my application through in-app purchase is in currently in Trial period or not.

对于 Apple(ios 商店)来说,这是一个简单的标志,我可以在收据中找到.

For Apple (ios store) it was an easy flag which I could find in the receipt.

对于 Google Play,即使我正在使用 google play android 开发人员 API 进行服务器端调用,但响应本身不包含任何标志,以便我了解用户当前是处于付费还是试用期.

For Google Play, even though I'm making a server end call using the google play android developer API but the response itself does not contain any flags for me to understand whether the user is currently in paid or trial period.

有人对如何在谷歌世界中检测到这一点有任何明智的建议吗?

Does any one have any smart suggestions of how to detect this in the google world?

推荐答案

其实现在看来V2真的不提供这个.到目前为止,我最好的替代方法是跟踪第一次购买的时间(例如,从用户收到的第一次购买收据中读取它),然后将此时间戳与当前时间进行比较试用期的持续时间.

Actually it seems like this really ins't offered by V2 at the moment. The best alterantive that I have though of so far would be to keep track of the first time this purchase was made (e.g. reading it our from the first receipt that the user received for the purchase) and then comparing this timestamp to the current time using the duration of the trial period.

这可以从 InAppProducts.get 部分的 trialPeriod 中读取相应的 productId.

This can be read from trialPeriodof the InAppProducts.get part for the respective productId.

https://developers.google.com/android-publisher/api-参考/inappproducts

如果有人有更好的解决方案,我很乐意在这里阅读.

If anyone has a better solution, I would be happy to read it here.

这篇关于检测当前订阅是否为 Google Play 商店的试用版?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆