Hyoct
Hyoct

Reputation: 11

Inapp purchases failing to acknowledge

I'm having some trouble dealing with the new inapp billing library (version 4)

Ever since I updated the billing library in my app some user purchases are failing to be acknowledged, therefore they get refunded within 3 days, while other work just fine.

My theory is that because of the app only sending an acknowledge request once when a SKU is bought, said request might sometimes fail and the thing remains unacknowledged. That'd explain why some purchases are working and other aren't, getting refunded in the process.

I thought of writing a condition that always sends an acknowledge request whenever a SKU is purchased but isn't acknowledged as a possible solution. This would always send an ackowledge request as long as it's purchased and not acknowledged, therefore if the acknowledge request fails it'd just send it again until it's approved.

I was wondering if successfully processed inapp purchases failing to acknowledge is common?

Upvotes: 1

Views: 2500

Answers (1)

utku glsvn
utku glsvn

Reputation: 40

Check it https://developer.android.com/google/play/billing/integrate#process play billing document, you use to subscription package to acknowledge

Once a user completes a purchase, your app then needs to process that purchase. In most cases, your app is notified of purchases through your PurchasesUpdatedListener. but there are cases where your app is made aware of calling BillingClient.queryPurchasesAsync() as described in Fetching purchases.

Your app should process a purchase in the following way:

Verify the purchase.
Give content to the user, and acknowledge delivery of the content. Optionally, mark the item as consumed so the user can rebuy the item.

To verify a purchase, first, check that the purchase state is PURCHASED. If the purchase is PENDING, then you should process the purchase as described in Handling pending transactions. For purchases received from onPurchasesUpdated() or queryPurchasesAsync(), you should further verify the purchase to ensure legitimacy before your app grants entitlement. To learn how to verify a purchase properly, see Verify purchases before granting entitlements.

Once you've verified the purchase, your app is ready to grant entitlement to the user. After granting entitlement, your app must then acknowledge the purchase. This acknowledgment communicates to Google Play that you have granted entitlement for the purchase.

Upvotes: 1

Related Questions