According to Google documentation, subscriptions automatically renew until they are canceled. A subscription can go through the following states:
As shown below, current Google Billing v5 implementation contains 3 states (Purchase.STATE_PENDING, Purchase.STATE_PURCHASED and Purchase.STATE_UNSPECIFIED
):
How do I check for "in grace period" and "cancelled" states so that my app can allow user access to paid content?
TIA
- Active: User is in good standing and has access to the subscription.
- In grace period: User experienced a payment issue but still has access while Google is retrying the payment method.
- Cancelled: User has cancelled but still has access until expiration.
- On hold: User experienced a payment issue and no longer has access while Google is retrying the payment method.
- Paused: User paused their access and does not have access until they resume.
- Expired: User has cancelled and lost access to the subscription. The user is considered churned at expiration.
As shown below, current Google Billing v5 implementation contains 3 states (Purchase.STATE_PENDING, Purchase.STATE_PURCHASED and Purchase.STATE_UNSPECIFIED
):
checking subscription state:
Wait For (billing.ConnectIfNeeded) Billing_Connected (Result As BillingResult)
If Result.IsSuccess Then
Wait For (billing.QueryPurchases("subs")) Billing_PurchasesQueryCompleted (Result As BillingResult, Purchases As List)
If Result.IsSuccess Then
For Each Purchase As Purchase In Purchases
Log(Purchase.PurchaseToken)
Log(Purchase.IsAutoRenewing)
Log(Purchase.PurchaseState)
Log(Purchase.Sku)
Log(Purchase.Signature)
Log(Purchase.PurchaseState) 'no sevice for states" cancelled, pending, paused, expired
Select Purchase.PurchaseState
Case Purchase.STATE_PENDING
Case Purchase.STATE_PURCHASED 'I assume that this corresponds to Google billing api's active state.
Case Purchase.STATE_UNSPECIFIED
Case Else
End Select
Next
End If
End If
How do I check for "in grace period" and "cancelled" states so that my app can allow user access to paid content?
TIA
Last edited: