[Solved] Handling Google Play Inactive In-App products

IAP integration was pretty smooth and easy, but there is one corner case I’m stuck on.

In the Google Play Developer Console, products can be Active or Inactive. I’m trying to protect my code against the situation where I decide to deactivate a product from within Google Play and no longer want it to be purchasable in the app.

When I disable the product, .availableToPurchase still returns true, and it isn’t until I call .InitiatePurchase that it gives bad behavior. When that gets called, Google pops up a dialog that says “Authentication is required. You need to sign into your Google Account.”

Is there any way to detect that a product is Inactive in Google Play before you would make a call to .InitiatePurchase? Obviously from a UX perspective, I’d like to just remove that product from my in-game store if it detects that it is Inactive in Google. Obviously I can setup another server side service that keeps track of this for me, but that then requires me to keep that service in-sync with Google. Ideally there would just be a way in Unity IAP to query this information.

Thanks for the help.

@trdinich

This isn’t something that is currently available in Unity IAP. As you can imagine, supporting multiple stores means that not all features of every store will be available, in an effort to make the API consistent.

I can see how this would be a useful feature though. You should consider submitting it to our Feedback Request page:
https://feedback.unity3d.com/forums/unity/suggestions?category=analytics
(Note: There is no IAP category, but Analytics will work.)

We use the feedback from this page to determine what features developers are most interested in so we can best focus our resources.