I want to implement in app purchase in my app in android. Can anybody help me for best example for this, and how can I test with sandbox account?
4 Answers
you can use test purchase package for testing inapp provided by google. use this product id for testing "com.test.purchased" it redirects you to test inapp product id .

- 88
- 1
- 7
-
1Its not "com.test.purchased". It is "android.test.purchased". This is mentioned here : 'http://developer.android.com/google/play/billing/billing_testing.html#billing-testing-static' – YuDroid Oct 03 '13 at 10:50
-
1this doesnot work for in-app subscriptions, any idea how to test subscriptions? – Rat-a-tat-a-tat Ratatouille Mar 17 '15 at 07:10
-
Rat-a-tat-a-tat Ratatouille: did you get any idea how to test subscription? – Ashish Jain Jul 13 '17 at 10:34
You can read this
http://developer.android.com/google/play/billing/billing_overview.html
For test your app you must publish this app on google play, There is no sandbox for in app purchase for android

- 510
- 1
- 5
- 15
-
2there is no need to publish the app developer has to just upload apk and make it as draft application but developer has to publish product ids to test app from test account. This step is required to generate application specific public key. – Ankit Apr 04 '13 at 19:05
-
Draft Apps are No Longer Supported https://developer.android.com/google/play/billing/billing_testing.html?rd=1#draft_apps – Bruno Lemos Jun 11 '17 at 02:16
https://developer.android.com/google/play/billing/billing_testing#prepare
You can check this link for test purchases
There are three reserved product IDs for testing static Google Play Billing responses:
android.test.purchased When you make an Google Play Billing request with this product ID, Google Play responds as though you successfully purchased an item. The response includes a JSON string, which contains fake purchase information (for example, a fake order ID).

- 11
- 2