Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Using IAB for subscriptions? — Gideros Forum

Using IAB for subscriptions?

PaulHPaulH Member
edited December 2016 in General questions
Is it possible to use IAB (in app billing) to handle subscriptions? Specifically, to detect the start and end of a subscription?

I've found a discussion on doing so with the GoogleBilling plugin: http://giderosmobile.com/forum/discussion/4475/status-of-google-billing-subscriptions/p1

Does anyone know of a way to do this with IAB or any method that supports both the Play Store and iTunes?

Paul

Comments

  • Looking Google Billing V3 documentation, my impression is that getPurchases() responds with the products the user currently owns, as opposed to things they have purchased in the past, and can be called with "inapp" or "subs" to get both one-time products and subscriptions. In the IAB source I see that it gets called for both. It would appear that doing an iab:restore() will respond (with a PURCHASE_COMPLETE event) for each item returned in getPurchases(), which would include the product IDs of any subscriptions that are currently active.

    If that's true, then using iab:restore() and checking the results for the product ID of a subscription should be all that's needed to determine if the user is currently subscribed.

    Or am I missing something?

    Paul
  • In case anyone else is interested...

    Yes, IAB will have a PURCHASE_COMPLETE event for a subscription item (at least on the Play Store), both at the time a subscription is purchased, and during an iab:restore(). That's all good except: The purchase event contains only the product ID, and no receipt ID. So it's possible to tell if a user is still subscribed (you get that product ID during a restore) but without a receipt ID, there's no way to know if a user subscribed on a different device. In my case, here's why that's problematic:

    My app will entitle a user to an add-on every week as long as they are subscribed, and those accumulate. If the user waits 10 weeks between subscribing and running the app again (at which time they are still subscribed), they get 10 add-ons. The app can tell when a subscription starts (when a purchase_complete happens that isn't within an iab:restore()), so that's manageable. What I was hoping to implement was the preservation of entitlements for users who replace a device. If there was a receipt ID passed through IAB, then my server (which keeps track of when each receipt was first reported) would know how long the subscription has been active, and thus how many add-ons the user is entitled to. Lacking a date or receipt ID, there's no way to tell how long a subscription has been active, in the case of someone running on a new device, or after an uninstall and reinstall.

    Paul

    Likes: pie, antix

    +1 -1 (+2 / -0 )Share on Facebook
Sign In or Register to comment.