简体   繁体   中英

I have a question about Google Purchase Library

I am using 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. 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. Which is the most correct usage?

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

You can track using billingClient object acknowledgePurchase Listener as below:

 billingClient.acknowledgePurchase(acknowledgePurchaseParams) { itBillingResult ->

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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