Warm tip: This article is reproduced from serverfault.com, please click

Android In-App Subscription Implementation

发布于 2021-01-05 10:25:15

I am dealing with In-app purchase stuff in Android.

Learned about In-App purchase for different types: Consumable, Non-Consumable and Subscription.

For the Subscription type I come to know that :

If your app stores subscription state on a secure backend server, your app should listen for state changes using Real-time developer notifications to ensure the state is kept in-sync. A SubscriptionNotification is sent for events affecting subscription states such as renewals and cancellations. You need to call the developer API after receiving Real-time developer notifications to get a complete status and update your own backend state. These notifications tell you only that the subscription state changed. They do not give you complete information about the overall subscription status.

Here, secure backend server come in to picture. From the above text content, we know what's the need for it.

But Can We implement Subscription functionality without the use of Back end server?

Can I track the purchased subscription details?

Thanks.

Questioner
Jaimin Modi
Viewed
0
Jaimin Modi 2021-01-12 12:34:26

By going through whole documentation, I come to know below things :

Google will take care of all purchases based on product type.

If we are using Non-consumable or Subscription based products Google will keep track of it, In case of Consumable products Google will keep it's record till your app consumes that product.

If your application sends a purchase request Google will associate it with primary gmail account registered on android device and will not allow to purchase same product again.

NOTE:- If We are using IAB-2 then above product type and flow will slightly different Non-consumable ** is known as **Managed Products Subscription is same as Subscription Consumable is known as Unmanaged(consumable) products.

If we are using IAB-2, google will never keep record of Unmanaged(consumable) products and it is your responsibility to keep records if you want.

Documentation here