简体   繁体   English

我有一个关于 Google 购买库的问题

[英]I have a question about Google Purchase Library

I am using billingclient:billing:4.0.0.我正在使用 billingclient:billing:4.0.0。 When a subscription or a product is sold, I want to register it.当订阅或产品售出时,我想注册它。 So for example,例如,

sub_1
sub_2
sub_3

Let's say I have a product, when my user buys sub_2 , I want to record his purchase by sending him a warning message.假设我有一个产品,当我的用户购买sub_2 ,我想通过向他发送警告消息来记录他的购买。 What step should I use to do this?我应该使用什么步骤来做到这一点? In other words, after determining that the purchase has been fully approved and passed all security, I will record this information in my database.换句话说,在确定购买已完全批准并通过所有安全后,我会将这些信息记录在我的数据库中。 I am not sure at which step I should make this recording.我不确定应该在哪个步骤进行录音。 Many sources say I should do this under onPurchasesUpdated, but I can't be sure.许多消息来源说我应该在 onPurchasesUpdated 下执行此操作,但我不能确定。 Which is the most correct usage?哪种用法最正确?

https://developer.android.com/google/play/billing/integrate https://developer.android.com/google/play/billing/integrate

You can track using billingClient object acknowledgePurchase Listener as below:您可以使用 billingClient 对象acknowledgePurchase Listener 进行跟踪,如下所示:

 billingClient.acknowledgePurchase(acknowledgePurchaseParams) { itBillingResult ->

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM