In my mind, I can only puchase one item at one time in Google App.
The Code A is from the project play-billing-samples, you can see here.
purchases: MutableList<Purchase>
maybe exist multiple items, it seems that I can purchase these items simultaneously through Google Play, right?
Code A
override fun onPurchasesUpdated(
billingResult: BillingResult,
purchases: MutableList<Purchase>?
) {
when (billingResult.responseCode) {
BillingClient.BillingResponseCode.OK -> {
// will handle server verification, consumables, and updating the local cache
purchases?.apply { processPurchases(this.toSet()) }
}
BillingClient.BillingResponseCode.ITEM_ALREADY_OWNED -> {
// item already owned? call queryPurchasesAsync to verify and process all such items
Log.d(LOG_TAG, billingResult.debugMessage)
queryPurchasesAsync()
}
BillingClient.BillingResponseCode.SERVICE_DISCONNECTED -> {
connectToPlayBillingService()
}
else -> {
Log.i(LOG_TAG, billingResult.debugMessage)
}
}
}
It turns out that you can set a limit for spendings on Google Play that can prevent you from making impulsive purchases. This setting leaves under Account > Purchase history.
As part of Android's June quarterly update, Google Play will be getting a nifty new feature that will allow you to use your accrued Play Points to pay for in-app purchases without ever leaving your app or game.
Before downloading an app, you can check if it offers in-app purchases: On the Google Play Store app, in-app purchases will be by the Price or Install button. On play.google.com/store, you'll see "Offers in-app purchases" below the name of the app.
Tech giant Google said that it will enforce its Google Play rules that require all app developers on the Play Store to use its in-app payment system. With this move, all Android developers will use Google's billing system which takes a 30 percent fee from payments. So what qualifies for in-app purchases?
An user can own the same in-app item only once, but he can own different items at the same time.
Other solution is to consider the item as consumable:
if billingClient.consumeAsync()
is called at the end of the purchase process then he can buy the same item again, but you have to keep track of how many times he bought it by your own means, probably through a backend server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With