anjlab / android-inapp-billing-v3

A lightweight implementation of Android In-app Billing Version 3
Other
2.19k stars 532 forks source link

Support promo codes in app #443

Open rausNT opened 4 years ago

rausNT commented 4 years ago

You must identify and handle promo codes. Your app must call the queryPurchases() method whenever the app starts or resumes. How to call an analog of this method?

c0dehunter commented 4 years ago

I am also not sure how to support promo codes with this library. Can someone chime in?

Readme says:

You can use promo codes along with this library. Promo codes can be entered in the purchase dialog [...]

But I can't see any field to enter promo code:

image

jlr1001 commented 4 years ago

Promo codes do work with this library. I've had "customers" use them in my game.

When they bring up the purchase screen they can select to redeem a code in the payment dropdown box. So if you've set up your product/IAP correctly in the Google Play Developer's Console, then you should be fine--I'm not in front of Android Studio at the moment, so if there's anything you need to do I'll come back and let you know.

@c0dehunter, the reason you're seeing that screen is because you are checking it via the account associated with Developer's console, or one you've entered as a tester account. In that case you can only run test purchases. Similarly, when you make the IAP's live you'll be blocked from completing a purchase from your dev google account--I guess this is to prevent you skewing sales.

Make IAPs live, and if you have a google account that's not associated with your Developer's Console, try to use one of your promo codes then. It should work fine.