I have setup Iab in my game for the first time, and I'd say it's working (no crash and google pay popup on iab:purchase() )
1) I don't understand how to setup test purchases:
google docs says to use "android.test.purchased" as a product id (here:
http://developer.android.com/google/play/billing/billing_testing.html#billing-testing-static ); which should be already known to google as a test product, but If I setup a product with that product id and I try to buy it I get the error:
Unable to buy item (response: 5:Developer Error) |
I think that this is the relevant part where maybe I am missing something:
iab:setProducts({nomoreads = "android.test.purchased"})
--...
iab:purchase("nomoreads") |
2) How do you manage a "remove ads" product?
Just save a variable to check on "premium mode" on PURCHASE_COMPLETE and restore purchases sometimes when connection is up - to check if you still get the same receipt or if a refund was made?
Thank you
Comments
1) You can't purchase test from your own google developer account, you need to add test accounts and purchase through them
2) app needs to be signed apk and not debug
3) you already purchased test product, but did not consume it. Consumption is done automatically by IAB plugin, if you provide your id with setConsumables method, otherwise you can only purchase product with this id only once
Likes: pie
However I encountered a bug (which is from google) : signature verification failed on any purchase and Product_Error event on requestProducts().
This happens when "android.test.purchased" is used.
To spare the pain of search to others, this worked for me to get rid of it:
-close app
-clear data of Google Play Store application
-clear data of Google Play Services
-run Google Play once
Thanks and happy that it is solved.
I believe that the app with billing permissions or the in-app purchase were still being processed by google play market/developer console at the time I was trying - it just worked after 10 hours or so
I can add that if you try to buy in-app from the editor profile you get a specific error in the google popup, not the anonymous response: 5:Developer Error.
I am using a gideros player with all the needed plugins, signed as my Alpha staged app (same permissions, same version numbers) and it works like a charm on android device.
great job ar2rsawseen =D> thank you
Consumption is done automatically by IAB plugin, if you provide your id with setConsumables method, otherwise you can only purchase product with this id only once
- Is it expected that purchases made with promotional codes return an "empty string" as e.receiptId value in Event.PURCHASE_COMPLETE?
thanks again
Basically it will make your product to be purchased again, after it is consumed.
The only problem raises, when your product is consumable, but you did not add it as setConsumables, and thus you can't purchase it again.
Without adding yourself as one, you can't test purchase, even as developer.