Issue: Google Play In-App Purchase(IAP)
While working with Google Play In-App Purchase feature, follows
After uploading Trivial Drive app in Alpha Testing, and configuring Store listings and In App products and charges, published app in Google Play Developer Console.
While testing the Trivial Driver app,
on a device with test account… Im able to Buy Gas
but when i tried to click on button for Upgrade My Car, or Get Infinite Gas, I see following error
At first I just confused about it. Later I find that there is a difference between Product Id that I created in In-App Products Developer console, and SKU_Productid constants written in code. as shown below In code
// SKUs for our products: the premium upgrade (non-consumable) and gas (consumable) static final String SKU_PREMIUM = "premium"; static final String SKU_GAS = "gas"; // SKU for our subscription (infinite gas) static final String SKU_INFINITE_GAS = "infinite_gas";
In In-App Products
SO, I just changed code for SKU_ProductId constants to match with In-App products created in Developer console. And Changed application version code and name in manifest file, Generated new APK file and uploaded to Developer console Alpha Testing. After 2-3 hours waiting, its got published.. and I see everything is working fine. to summarize whole thing, you just need to use same SKU_ProductId in code, which is created in In-App Products developer console.
Hope it helps somebody…
Few other reference for In-App Billing app testing
* https://blahti.wordpress.com/2014/07/30/how-to-add-in-app-billing-in-android-part-1/ http://android.stackexchange.com/a/40827/101168