Quick Links: Gideros Home | Download Gideros | Developer Guide
IAB requestProducts() no longer returning subscription products
  • PaulH +1 -1
    Member
    Using Gideros 2017.9, calling iab:requestProducts() with Google I'm getting back all the expected products except for a monthly subscription product. I don't know when that stopped working, but it was working in 2016.8.1. I also don't know if this is an issue with frameworks other than Google.

    I see that IAB has been changed in recent Gideros updates. Could one of those changes have effected how the plugin handles subscriptions?

    Paul
  • PaulH +1 -1
    Member
    I've done some more testing, but have still been unable to get Gideros 2017.9 to retrieve subscription products with IAB. I've gone back to using 2016.8.1 and released my update with that.

    If anyone has any insight into why subscriptions no longer work, I'd really appreciate it. A lot of great improvements have been made to Gideros since 2016.8, but for my biggest earning app, I need the subscriptions in IAB.

    Paul
  • Are you sure that was in the iab plugin? There are no signs of subscriptions. There was a different billing library before iab - googlebilling. It may have been in that? That was using v2 of the google payments system. The iab was made to unify apple, google and amazon payments for Gideros and also to update to v3 of the google payments system.
  • Can you post a bit of your code that accesses the plugin so we can see what system you used?
  • PaulH +1 -1
    Member
    The relevant code is something like this:
    require "iab"
    iab = IAB.new("google")
    iab:setUp(google_store_key)
    iab:setProducts(
    {
    monthly_subscription_product_id = "GooglePlayMonthlySubscriptionProductID",
    other_product_id = "GooglePlayOtherProductID"
    }
    iab:addEventListener(Event.AVAILABLE,
    function(e)
    iab:addEventListener(Event.PRODUCTS_COMPLETE,
    function(e)
    for i = 1, #e.products do
    local p = e.products[i]
    -- make note of id, title, description and price
    end -- of loop through available products
    end -- of products complete
    )
    end -- of function called when store is available
    )
  • PaulH +1 -1
    Member
    Here's the code in a text file that preserves the indentation to make it more readable.
    code_snippet.txt
    612B
  • PaulH +1 -1
    Member
    The code in iab\frameworks\google\IabHelper.java seems to use Google Billing V3 to handle subscriptions.
  • Could you upload a zip of the previous plugin that worked? I'd like to see if something has changed from that to the current version on github.
  • PaulH +1 -1 (+1 / -0 )
    Member
    I'm attaching the Google framework files from the plugin from last summer's version. In the current version of the Google framework, IabHelper.java at line 253 includes some new code for dealing with subscriptions via Google Billing V5. It looks like some significant changes have been made to handling subscriptions.

    Here’s what seems to be broken: The function queryInventoryAsynch() (currently line 686 of IabHelper.java) used to take 3 parameters, and now it takes a fourth. The additional parameter is a list of subscription SKUs. In the past it looks like that method used the same list for subscription and non-subscription SKUs. When queryInvetoryAsynch() is called in the current code (from line 91 of IabGoogle.java) it’s called with null for the list of subscription SKUs. That null parameter gets passed to queryInventory(), which then effectively ignores all subscriptions.

    I don't know the code well enough to propose an appropriate fix, but it would seem that with the changes made so far, queryInventoryAsynch() needs to be called with another SKU list for the subscriptions. As far as I know, there's no mechanism in the plugin interface to specify which SKUs are subscriptions, however. A quick fix might just be to pass the same SKU list in for both subscriptions and non-subscriptions when calling queryInventoryAsynch, trusting Google to respond only to the ones presented accurately.

    Paul

    Likes: SinisterSoft

  • PaulH +1 -1 (+1 / -0 )
    Member
    Here's last year's version of the relevant code.
    iab_plugin_frameworks_2016_8.zip
    24K

    Likes: SinisterSoft

  • PaulH +1 -1 (+1 / -0 )
    Member
    Thanks. No rush - I've released my update using the older version of Gideros, but I'd still really like to see this resolved so I can use the current version with this app in the future.

    Paul

    Likes: antix

  • PaulH +1 -1 (+1 / -0 )
    Member
    Just checking in on this - Have you had a look at the changes to subscription support? I'll be publishing an update in the next few weeks, and I'd love it if I could use the current version of Gideros.

    Thanks,

    Paul

    Likes: antix

  • To look/test I'll have to add subscription to one of my games. I haven't had time to yet...

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with OpenID

In this Discussion

Top Posters