9

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?

Kara
  • 6,115
  • 16
  • 50
  • 57
vertti
  • 7,539
  • 4
  • 51
  • 81

2 Answers2

3

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.

Oleksii Masnyi
  • 2,922
  • 2
  • 22
  • 27
  • Thanks but it's not that, I used signed apk. And my test phone uses different google account than my Market developer account. – vertti Feb 20 '12 at 08:28
3

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)..

hacker
  • 8,919
  • 12
  • 62
  • 108
  • Yeah, this is what I was left wondering, how/where can I publish the in-app item? They are shown as unpublished and the developer console says that as long as the app is unpublished, the in-app items will be too. – vertti Feb 20 '12 at 09:34
  • 1
    you don't mind that message..Once you create a product you can go for edit that product..So you will have publish,save and delete buttons..In your case you can go for publishing that product..That will solve the issue.. – hacker Feb 20 '12 at 10:08
  • Thank you! That was it. What a completely misleading information and bad usability for the console. – vertti Feb 20 '12 at 10:18
  • @hacker I cant find Publish button, as I asked in http://stackoverflow.com/questions/23937336/where-is-publishing-state-for-a-product-in-google-in-app-billing, can you give me a hint. – Reza May 29 '14 at 16:28