Reputation: 31
How do you test non-consumables in your Android apps? ("noADs" as instance) If "noAds" already purchased All I do (reinstall the game, install it on other device) it doesn't lead to anything: I don't see the purchase again (it always restores automatically).
Google says: "To perform multiple test purchases for the same non-consumable product, you can refund and revoke purchases using Google Play Console."
Yes, it works. May be after the /adb shell pm clear com.android.vending/ But it really hard to do it every time.
So, do you really do it the same way each time?!! Is there no way (for example) to add a cheat to the app: if it's activated, the device doesn't send the request to purchase restoring. Or doesn't receive the server answer... or something else?? Or does Google Play Billing do all of these automatically and block all attempts to interfere?
Upvotes: 3
Views: 3393
Reputation: 181
I had this problem and solved it as follows:
Done, now you can buy your non-consumable test again!
If you forgot to check the "Remove entitlement" box, don't worry, there is a solution: consume the purchase.
Add this temporary JAVA code and run it in your app:
public void testConsumePurchase(Purchase purchase) {
billingClient.consumeAsync(ConsumeParams.newBuilder().setPurchaseToken(purchase.getPurchaseToken()).build(), new ConsumeResponseListener() {
@Override
public void onConsumeResponse(@NonNull BillingResult billingResult, @NonNull String s) {
Log.i("onConsumeResponse", "Consumed!");
}
});
}
Or you can copy the "purchase token" from Google Play Console and use the following method:
public void testConsumePurchase(String purchaseToken) {
billingClient.consumeAsync(ConsumeParams.newBuilder().setPurchaseToken(purchaseToken).build(), new ConsumeResponseListener() {
@Override
public void onConsumeResponse(@NonNull BillingResult billingResult, @NonNull String s) {
Log.i("onConsumeResponse", "Consumed!");
}
});
}
After this, remove the code. Done, now you can buy your non-consumable test again!
If you use Kotlin, I recommended you visit: here.
Note: I am using the Google Play Billing Library 4.1.0 version.
I hope this is useful, regards! 😁/.
Upvotes: 12
Reputation: 631
Go to https://play.google.com/apps/publish/
In the left menu tab "Order management"
The page will contain a list of payments. You can make a refund here.
Upvotes: 2
Reputation: 75
I recommend you to use:
BillingClient.acknowledgePurchase()
Take a look here: https://developer.android.com/google/play/billing/integrate#process
Upvotes: 0