您如何检测用户的现有订阅价格是否已更改(Google Play应用内购买)? [英] How do you detect if a user's existing subscription's price has changed (Google Play in-app purchase)?

查看:71
本文介绍了您如何检测用户的现有订阅价格是否已更改(Google Play应用内购买)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google拥有文档,如果订阅的价格发生了变化,该怎么办.

Google has documentation of what to do IF a subscription's price has changed.

您应该使用计费客户端并启动 PriceChangeConfirmationFlow .但是,您如何首先确定价格是否发生变化?

You're supposed to use a billing client and launch PriceChangeConfirmationFlow. However, how do you detect if the price has changed in the first place?

什么Android库API会告诉我?

What Android library API would tell me that?

SkuDetails有价格,而"Purchase"没有.他们只是使用"productId"引用SkuDetails.我在看原始的json.如果Purchase对象中有价格,我可以将其与SkuDetails中的当前价格进行比较,但是没有.

The SkuDetails have the price, but the Purchase details don't. They just refer to the SkuDetails using the "productId". I'm looking at the raw json. If the Purchase object had a price in it, I could compare it to the current price in the SkuDetails, but it doesn't.

推荐答案

使用计费API查询用户广告资源时,您会获得 Purchase 对象,其中包括

When you query for the user inventory with the billing API, you get Purchase objects which include the purchase time. A bit of a hacky solution is to look at that date and if it's before the time you changed your price, you initiate the flow with launchPriceChangeConfirmationFlow().

这篇关于您如何检测用户的现有订阅价格是否已更改(Google Play应用内购买)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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