8

I am using google in-app billing v-3 to implement Subscription.

My Subscription has one week Trail period and UI displays "Avail A Week Free" View.
If the user Subscribes and cancels for any reasons, I need to display "UpGrade" View.

As far as I googled, I learned that if users cancel's subscription while in the period of active subscription, INAPP_PURCHASE_DATA_LIST autoRenewing flag will return false.And after the subscription period ends getPurchase() could return empty.

In this scenario how could I know which UI to display, hence getPurchase() will return empty for both, when the subscription expires and when User has not Subscribed.

ganesh
  • 1,247
  • 6
  • 24
  • 46

1 Answers1

10

Since any user can use trial only once you can check getPurchaseHistory() and see if the user has ever been subscribed to your subscription. If he was - you need to show "UpGrade" view, otherwise, you can show "Avail A Week Free" View.

TpoM6oH
  • 8,385
  • 3
  • 40
  • 72
  • Yes,I have updated my aidl file to make use of mService.getPurchaseHistory() and replaced apiVersion to 6 instead of 3 in all IInAppBillingService calls, – ganesh Apr 27 '18 at 19:06