14
votes

From what I understand reading This link. It appears to me that the only way to test in app purchase is to write the complete code for in app purchase. And then do a proper build. Upload it to beta release. And then download the app via the opt in link.

But how do I develop it in the first place? Am I expected to write some lines of code and then do a build and upload it? That is a huge turn around time. Is there no way for me to have some test account that I can sign in go google play (on phone) with and then just make purchases?

Currently, my code already handles the products

android.test.purchased and android.test.canceled. How do I make it so that I can test my own products Ids? Currently it just says the product you are requesting is not available.

2
Should we wait for days for "pending" or is there another way these days?Namikaze Minato
@NamikazeMinato Put yourself in the "whilte list" or something. And simply go through the normal build process. I believe you can test the workflow by purchasing normally. It won't charge you on the credit card.Zhen Liu
Thanks but I think I did not get it yet. What is the white list and normal build? I want to test the subscription purchase. Made a test app and built a release, uploaded under internal test and waiting for days... The problem is that I can't run my own app and test the purchase before google approves it (in internal test).Namikaze Minato
For example if I want to use a server and firebase, I need to try some code (this is my first time). So, every time it goes into the pending state for days before testing the app. Is there any other way?Namikaze Minato

2 Answers

6
votes

Google allowed to test your in app purchase in for dummy products like you mentioned android.test.purchased. To test real products you must have to deploy application in beta release at least. Following article will help you in detail :

An Android Studio Google Play In-app Billing Tutorial

Hope it will help.

1
votes

You need to publish your application in beta version in play store to review the application. Without reviewing your application, you cannot test app purchases. After the review you can test your application without redeploying it to play store.