TheGameCreators / AGK-Studio

3 stars 1 forks source link

Inapppurchases for consumables for Android not working + cancel sale not working either #1087

Closed JamesClent closed 1 year ago

JamesClent commented 1 year ago

In our game we have build the Inapppurchases for iPhone and Android. On Applestore you can define if an inapppurchase is consumable or not. On google developer console you cannot. So we are told to use the function GetInAppPurchaseToken and InAppPurchaseResetPurchase, to be sure this works, we also run GetInAppPurchaseAvail2 to make sure it goes back to 0. (See image for code) == the message() functions were built in to test if it was even working at all at the time of reset, they were not there when first testing.

iap_code

However, when purchasing the item again AFTER doing this, google says you already own this, and retuens GetInAppPurchaseAvail2 as 4 immediately. So my users get anothe set of skips for free.

On iPhone this all works perfectly.

My thought was to initialize the InAppPurchase item as consumable, but the compiler refuses that with a message that consumable is no longer supported..

In other words, on Android I cannot purchase a consumable item! I have screenshots of all

The documentation says that I should get a unique token after the purchase, but both times the token is exactly the same. I'm either doing something wrong that is not documented, or the resetpurchase function for android is not working.


The second prolem I have is with buying of InAppPurchases on Android and NOT completing the purchase. On iPhone the GetInAppPurchaseAvail2 will go from pending to not purchased, on Android it remains pending.... Hence my program is sitting in a permanent loop waiting for a 4 (puchased) or 0 (not purchased)

The working on Android and iPhone is again not the same, where iPhone works as expected, and Android doesn't. This behavior is true for ALL inapppurchases, not just Consumables. Perhaps this should be too tickets, I don't know.

If so let me know and I will split them. However, I need both resolved to be able to put my game on the market.

Thanks James

VirtualNomad19 commented 1 year ago

If so let me know and I will split them.

please do separate them.

JamesClent commented 1 year ago

Second part moved to new issue. But I cannot delete it from this ticket.

JamesClent commented 1 year ago

First part is now ticket 1089, 2nd part is ticket 1088

JamesClent commented 1 year ago

Done. Closed ticket 1087 and created 1088 and 1089 Thanks, James

On Thu, Mar 23, 2023 at 7:49 PM Virtual Nomad @.***> wrote:

If so let me know and I will split them. please do.

— Reply to this email directly, view it on GitHub https://github.com/TheGameCreators/AGK-Studio/issues/1087#issuecomment-1482099723, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM2MLRXDZLTW7GIHSCKK4XDW5TVRFANCNFSM6AAAAAAWFPWKOY . You are receiving this because you authored the thread.Message ID: @.***>