Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
two questions on android iab implementation [test and check purchases] — Gideros Forum

two questions on android iab implementation [test and check purchases]

piepie Member
edited January 2016 in General questions
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

  • There are many things that I've heard could be wrong with this error, I don't know which is true, but maybe it will help you.

    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

    +1 -1 (+1 / -0 )Share on Facebook
  • piepie Member
    Thank you, it's working now. :)

    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

  • talistalis Guru
    edited January 2016
    @pie just for information for me and others how you solved your problem? What did you changed?
    Thanks and happy that it is solved. :)
  • piepie Member
    @talis I didn't do anything, just slept over it.
    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
  • piepie Member
    I'm sorry @ar2sawseen I still have a couple of questions about purchases:
    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
    Assuming that I did
    iab:setConsumables({"myItem"})
    - How do I tell IAB when the time has come to consume "myItem"? I presume I can consume it when the user want to, am I right?

    - Is it expected that purchases made with promotional codes return an "empty string" as e.receiptId value in Event.PURCHASE_COMPLETE?

    thanks again :)
  • ar2rsawseenar2rsawseen Maintainer
    edited January 2016 Accepted Answer
    No, IAB plugin will automatically consume consumables, so you don't have to do anything. And yes, IAB plugin does it in purchase complete event.

    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.
  • Things that people are tend to forget is adding himself as Open Alpha tester, or it's kind.
    Without adding yourself as one, you can't test purchase, even as developer.
Sign In or Register to comment.