Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are auto-renewing android in-app subscriptions have to be consumed?

After hours reading documentation about android in-app product and subscription I am still stuck asking me about consumption process regarding in-app auto-renewing subscription.

What Google says about consuming

It's up to you to decide if you want to handle your managed products as non-consumable or consumable items

Non-consumable products

Typically, you would not implement consumption for managed products that can only be purchased once in your application and provide a permanent benefit. Once purchased, these products will be permanently associated to the user's Google account. An example of a non-consumable managed product is a premium upgrade or a level pack.

Consumable products

In contrast, you can implement consumption for products that can be made available for purchase multiple times. Typically, these products provide certain temporary effects. For example, the user's in-game character might gain life points or gain extra gold coins in their inventory. Dispensing the benefits or effects of the purchased product in your application is called provisioning the managed product. You are responsible for controlling and tracking how managed products are provisioned to the users.


In the other hand the Google Play Billing tell us that we have the following types of in-app products :

  • One-time products (managed products)
  • Rewarded products
  • Subscriptions

Reading this we could think that subscriptions aren't managed product..

I am trying to refacto a part of an app, at the moment the current version get the inventory (with an IabHelper), get the last monthly purchase (proceed automatically by google), send the information to our API to get user premium again and consume this last purchase after the API result.

Because I am now checking the monthly payments directly from our API, to remove this part from the Android app : Do we absolutely have to consume the monthly purchase proceed automatically with the auto-renewing Google in-app ?

like image 624
nekflamm Avatar asked Mar 24 '19 20:03

nekflamm


People also ask

What are automatically renewing subscriptions?

(also known as auto-renewal) Is a billing process where the customer's subscription is set to be renewed automatically at the end of their subscription period – weekly, monthly, annually or any other agreed-upon period of time – without the customer having to take action.

How does Google Play subscription work?

You can subscribe to these apps with Google Play. When you subscribe: You'll automatically be charged each renewal period depending on your subscription terms, for example: weekly, or annually. If you accept a $0/month trial offer, you'll get an email when your trial is about to end.


1 Answers

After working around in-app subscription (with our own API/Server) process for Android and iOS app, I think I found my answer.

In-app subscription android process

  • When a Android or iOS user makes a subscription, my app (in my case) completes the transaction and sends it to our own API (through /android_purchase POST) with some parameters (see the workflow above).
  • Right after our API verifies the transaction with Google (through /verify) and sends back the answer to our apps (giving the user access to premium content or not depending on the /verify result)

But how your API can know if the user cancel the subscription or just know if the subscription has been renewed correctly ?

Actually (and a lot of developer reading this know that) Google and Apple allow you to give them an API endpoint to get notified (in my case /in_app_notifications). Thanks to this feature, Google will notify us for each renewal or cancelation or even the first subscription action.

You can find some documentation about it here https://developer.android.com/google/play/billing/realtime_developer_notifications.html

This kind of workflow let us implement a clean workflow without any front-side check. Actually some apps check the last user payment at each app launch to notify the API and keep the user premium or not.


What if the user doesn't open your app for two months ?

Do you really think that the subscription is canceled by Google and Apple ?... In my mind the answer is no. For me, this workflow demonstrates that it's not the case. In the same way, if your android app doesn't consume the item purchased (in my case of a monthly in-app subscription) it won't "break" the subscription. Android will renew it at the end of the month and notify your API.


I know that my answer is not complete, and may be some developers will share some others searches, but I was struggling with this question about in-app subscription process and I wanted to share my findings to save your time if you are in the same situation !

like image 198
nekflamm Avatar answered Oct 14 '22 16:10

nekflamm