NEW WARNING: Google Play Billing

I submitted a new version to Google Play today using the latest build 3677, and I got this WARNING MESSAGE. Anyone working on this?

We’ve detected that this app is using an old version of Google Play Billing. By November 1, 2022, all app updates must use Billing Library version 4 or newer. Update to Billing Library 4 before this date. Learn More.

Yes it is important to note there is
google.iap.billing.v2 (which uses billing sdk 5.0.0) and google.iap.billing (which uses billing sdk 3)

As noted by the documentation the only api difference between the two is
"The only code change between Google API Billing v2 and Billing v1 is removal event.productList.products.originalJson and new publisherId in build.settings"

See google.iap.billing.v2 docs Solar2D Documentation — Plugins | google-iap-billing-v2

@Scott_Harrison I already have the IAP key setup in config.lua, so the real question is…

Are you saying that changing the plugin…
FROM
plugin.google.iap.billing
TO
plugin.google.iap.billing.v2 is all that is necessary to fix the problem, because the .v2 plugin supports the Google Play Billing Library 4?

Does it operate exactly the same way, such that we can trust the change thoroughly?

Thanks for the clarification @Scott_Harrison. I removed my confused comment so as not to confuse others.

Was any of the data from event.productList.products.originalJson moved into another table?
We check event.productList.products.originalJson.freeTrialPeriod to see if the item is a subscription item with a free trial period, but if originalJson has been removed that will break this functionality for us.

@troylyndon billing.v2 uses Google Play Billing Library 5 which would make that “warning” go away. As @alanFlickGames has already pointed out the changes might “break” some setup that depend on “event.productList.products.originalJson”. I believe that 80-90% of project that use billing.v1 will be able to easily switch to billing.v2 but I would still recommend testing game/apps before release them.

@alanFlickGames I will double check if “freeTrialPeriod” got moved or could be brought back. Its been a bit since looked Billing Library 5, but I remember that a lot less information was given in product list.

Is the issue reported by @alanFlickGames a native issue?

I’m using plugin.google.iap.billing, and I updated a few days ago without any complaints from Google. Were you (@troylyndon) still using plugin.google.iap.v3? I can’t use plugin.google.iap.billing.v2 because it breaks IAP Badger.

I’m using same as you - so your product list comes over properly with .v2 added?

I updated yesterday using plugin.google.iap.billing, and got the “Update to Billing Library 4” warning.

@troylyndon We’re not building using native, we’re building via the sim. It’s only relevant for subscriptions, which most devs aren’t using.

The v2 has been quite temperamental in the past as well from what I recall and we had gone back to using the older plugin.

I have tried rebuilding with V2 today (no helper plugins like badger etc, just the solar2d plugin) and I can confirm that the product list that’s being returned is missing any data on price, currency code etc. Only the title and description seem to be present.

There are no other errors and our code is quite straightforward so my conclusion is that the v2 plugin is not properly usable in its current state

EDIT: Also getting repeated callbacks for the Purchased state when testing so the item is being repeatedly granted to the user. Will look into this but I’m positive that our system worked flawlessly on V1. We are also consuming the purchase so I’m not sure what I’m doing wrong.

@famousdoggstudios good work! Any chance you can send your log output showing the Product List data, and lack thereof, coming back as the product list for both v2 and the non-v2 versions?

@Scott_Harrison @vlads this is a huge issue that needs to be corrected asap, otherwise all monetizing apps made updated with Solar2D after the November date will break.

No- I can’t use .v2. I’m still using my modified versions of IAP Badger, which relies on the event.productList.products.originalJson.

@Scott_Harrison- Is there a way to get event.productList.products.originalJson back in .v2, or bring plugin.google.iap.billing up to billing SDK 4 without losing event.productList.products.originalJson?

I’m currently just using some toasts to debug using live build but will try and get some logs from the device later.

With further testing, it appears that there are more issues. The documentation isn’t quite clear on what the finishTransaction function will do because I am calling it in the PURCHASED state callback but I’m getting 4-5 calls into PURCHASED for an item.

The entire flow for handling refunds, errors, restore and purchase was already very iffy and we had put a lot of effort into getting things running over the years so I’m seriously hoping that I don’t have to end up rewriting the whole thing.

@colinmorgan working on trying to bring it back (via workarounds), Google changed a lot between billing v3 and v5 (including killing the api used for originalJson for products).

@famousdoggstudios I have a fix for the missing data (i.e price and currency code), investigation the multiple purchased states

1 Like

Cheers Scott

Briefly, this is what I do:

Init-> Load products and make a UI-> call purchase function when user demands-> in purchased state, perform in-game action for product and if it is consumable, consume the purchase-> call finish transaction

There are some other arrangements that I did to allow reconsumption of purchases by catching error codes etc but basically, the above flow worked without issues.

I also seem to have previously added a short delay for a few millis before calling the consume operation on a purchase (didn’t add a comment specifying why I had done that, unfortunately) but I’ve now tried with and without the delay to no avail.

Thanks, Scott! I really appreciate your attention to this issue.

@famousdoggstudios nice description

Same for me. I updated one of my apps yesterday with V2 and the price of the purchased item does not appear. This is an important bug that should be fixed soon.

Yep same prob. i cant get price and localisedprice
@Scott_Harrison is there any chance you can get the fix for the missing data(i.e price and currency code) up before multiple purchases states?