Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Testing Android In-App purchases with unpublished apps

I'm using AndroidBillingLibrary to implement in-app purchases for my game.

I've done the following:

  • Added my public key from Market to my application
  • Uploaded my signed and in-app-purchasing-enabled apk to market (unpublished)
  • Created an in-app item in the market console (unpublished)
  • Added a test user account to my profile

Now with the test account I start my game and try to make a in-app purchase. I get the market screen and I can see the item details (so market does recognize the item id because those details are only in the market, not in my game) but then I get a pop up that says "The item you were attempting to purchase could not be found." and I'm returned to my game.

Now this page tells me that "Also, a test account can purchase an item in your product list only if the item is published. The application does not need to be published, but the item does need to be published."

but Market console tells me:

"An in-app product will appear UNPUBLISHED until the owning application is PUBLISHED, at which point the in-app product's publishing state applies."

So I can't change in-app items to published before publishing my game (which I don't want to do yet).

How can I test buying in-app items without publishing my game?

like image 301
vertti Avatar asked Feb 20 '12 07:02

vertti


2 Answers

You need to give public key (base64EncodedPublicKey) in Your security class which must be same as you given in your developer account..Also you have to publish your product even if the app is not yet published(that is saved as draft application)..

like image 99
hacker Avatar answered Nov 07 '22 13:11

hacker


You need to use signed apk.

  1. Build signed apk with your own production keys
  2. Upload signed apk to Android Market Developer Console
  3. Upload signed apk to device

Then make your test from a non developer account.

like image 31
Oleksii Masnyi Avatar answered Nov 07 '22 11:11

Oleksii Masnyi