2

In my application I use in app purchases. Within the start of the application I check if the user has purchased for the premium version with following code:

public void onBillingSetupFinished(int billingResponseCode) {
    Purchase.PurchasesResult result = billingClient.queryPurchases(INAPP);
    List<Purchase> purchasesList = result.getPurchasesList();
    isPremiumUnlocked = !purchasesList.isEmpty();
}

This works great but I as developer have the problem that I havn't purchased for the premium version and I can't do it because if I try to I get following message:

The publisher cannot purchase this item

So how can I avoid this problem? Is there some setting in the Play Console I have missed?

Cilenco
  • 6,951
  • 17
  • 72
  • 152
  • Have you tried to [configure a test account](https://developer.android.com/google/play/billing/billing_admin.html)? (**Setting Up Test Accounts** sub-header) – Pier Giorgio Misley Oct 19 '17 at 09:49
  • Good point! Yes I tried that but unfortunately this does not help... – Cilenco Oct 19 '17 at 09:54
  • After a couple of searches, what I found is that unfortunatly you can't test your own in app billing after the app is published [look here](https://stackoverflow.com/a/14371552/4700782) or [here](https://stackoverflow.com/a/37589674/4700782) for a couple of examples and explainations. [Here](https://developer.android.com/google/play/billing/billing_testing.html) you can find the way to test in app purchases (but with alpha or beta version) Let's see if anyone has another idea on how to solve that problem, but unfortunatly I think there are no ways to purchase your own products – Pier Giorgio Misley Oct 19 '17 at 09:57

1 Answers1

0

Actually I found a way to purchase my own items through promo codes.

  • Click on your application in the Play Console
  • User acquisition > Promotions > Add new promotion
  • Enter the product ID and check the checkbox for in-app promotions
  • Set the number of promotion codes to 1 and download the csv file
  • Enter the promtion code in the Play Store (Side menu > Redeem) on your phone or go to https://play.google.com/redeem?code=<code>
Cilenco
  • 6,951
  • 17
  • 72
  • 152