How to test in-App purchase in android?
Asked Answered
P

2

8

I want to test in-App purchase before publishing.How do i create a test account for this ? Can anyone help me with all procedures need to be done ?

Presentday answered 29/12, 2011 at 8:54 Comment(0)
P
7

Try using this tutorial

http://developer.android.com/guide/market/billing/billing_testing.html

Basically, you need to make a specific/reserved product ID that you want to test your in-app purchase with. In particular, you can use the android.test.purchased product ID to simulate a successful purchase.

Powdery answered 29/12, 2011 at 9:19 Comment(4)
Can I use this product ID to test subscriptions as well?Jefferey
YesPowdery
@Powdery - really? I get an Item Not Found error when I try setting the item type to subscription. Mind sharing how you do it?Outbalance
@Powdery I used the productId as you suggested,I was successfull through for the first time but from next time it thrown an exception as follows Attempt to invoke virtual method 'android.content.IntentSender android.app.PendingIntent.getIntentSender()' on a null object reference.My complete question is under link.Any idea ?Anaphora
B
2

You just use one on the following product IDs during a purchase operation:

android.test.purchased

android.test.canceled

android.test.refunded

android.test.item_unavailable

By using a restricted set of product IDs, you can trigger static responses from Google Play, so you can test that your app correctly handles all the possible states. You should use this when integrating the Play Billing Library into our app, or for instrumentation testing.

Buttonhole answered 18/6, 2020 at 12:36 Comment(1)
after how much time do they expire? or how to clear by ourself?Dispirited

© 2022 - 2024 — McMap. All rights reserved.