I have an Android app that uses In-App-Billing to sell Account Managed Items.
I tested the app with the static response IDs and everything seems to work. I now want to test the app with real product Ids.
I created the app in the Google Play Store and uploaded a draft version of the app with the correct permissions. I now created an In-App-Billing item and published the item.
At the moment the app is unpublished. The item is created and published and I have a test account that is registered in the profile of the developer account and is the only account on the device that I use for testing. The app is signed with the same key as the uploaded draft. Edit:I'm testing with Android 4.1 && 4.03 at the moment
If I try to buy the item the Google Play Store pops up but shows a dialog with the following method: The item you requested is not available for purchase.
How can I test buying the item without publishing the app?
Open the Google Play app. Choose Account -> Subscriptions & Payments -> Subscriptions. Click your test subscription and change the payment method to “Test card, always declines.”
Test in-app billing with application licensing. With application licensing, you can set up a list of Gmail accounts to test your in-app billing & subscription integration. Your own publishing account is always considered a licensed tester. To set up application licensing, start by adding your list of tester's Gmail addresses in the Play Console.
To test your Google Play Billing Library integration using test tracks, do the following: Publish your app to a test track . Note that after you publish an app to a testing track, it can take a few hours for the app to be available for testers.
We recommend publishing your app to the internal test track. Make sure that your testers are also eligible to receive your release by following the instructions for managing testers by email address or using Google Groups. You've set up a test environment.
With application licensing, you can set up a list of Gmail accounts to test your in-app billing & subscription integration. Your own publishing account is always considered a licensed tester. To set up application licensing, start by adding your list of tester's Gmail addresses in the Play Console.
It may take some time to reflect the changes on google play if you just uploaded the app and added the item there wait for some time near about 2 hr. it will be shown the item you want to purchase.
For others who reach this thread, Now it's not possible to test In-app billing with just a draft version
of the app.
Draft Apps are No Longer Supported Previously, you could publish a "draft" version of your app for testing. This functionality is no longer supported. Instead, there are two ways you can test how a pre-release app functions on the Google Play store:
You can publish an app to the alpha or beta distribution channels. This makes the app available on the Google Play store, but only to the testers you put on a "whitelist".
In a few cases, you can test Google Play functionality with an unpublished app. For example, you can test an unpublished app's in-app billing support by using static responses, special reserved product IDs that always return a specific result (like "purchased" or "refunded").
for details read https://developer.android.com/google/play/billing/billing_testing.html#billing-testing-test
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