Dat*_*eed 6 api android google-play google-play-services
我正在实现一项服务器端服务,用于检查用户的 google play 订阅状态。我使用 Android Publisher API ( https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/get ) 来检查订阅状态。不过,我无法理解如何区分用户是否处于试用期或者他是否已经付款(我需要它进行分析,归因于收入)?
如何才能做到这一点?
当您从服务器验证订阅购买时,您将获得如下订阅资源:
{
"kind": "androidpublisher#subscriptionPurchase",
"startTimeMillis": long,
"expiryTimeMillis": long,
"autoRenewing": boolean,
"priceCurrencyCode": string,
"priceAmountMicros": long,
"countryCode": string,
"developerPayload": string,
"paymentState": integer,
"cancelReason": integer,
"userCancellationTimeMillis": long
}
Run Code Online (Sandbox Code Playgroud)
该paymentState值有 3 种订阅状态:
0- 付款等待中1- 已收到付款2- 免费试用您可以随时调用 Google Play API 来检查此状态。API 文档:https://developers.google.com/android-publisher/api-ref/purchases/subscriptions#resource
| 归档时间: |
|
| 查看次数: |
2178 次 |
| 最近记录: |