androidandroid-studioin-app-subscription

Is "Test subscription-specific features" limited to a maximum of six times to test subscriptions in Google Play test environment?


The following content comes from the article.

Test subscriptions renew more quickly than actual subscriptions, and test subscriptions can renew a maximum of six times.

A: Does this imply that Google Play will automatically cancel a subscription when it reaches the maximum of six renewals in the Google Play test environment?

B: What will happen if Google Play cancels a subscription after it reaches the maximum of six renewals in the test environment? Will it appear as if the user never subscribed to the item? It seems that _purchases.value will return empty when Google Play cancels a subscription after it reaches the maximum of six renewals in the test environment by Code A.

C: What is the maximum number of renewals allowed for subscriptions in the real environment?

Code A

fun queryPurchases() {        
        billingClient.queryPurchasesAsync(
            QueryPurchasesParams.newBuilder().setProductType(BillingClient.ProductType.SUBS).build()
        ) { billingResult, purchaseList ->
            if (billingResult.responseCode == BillingClient.BillingResponseCode.OK) {
                if (purchaseList.isNotEmpty()) {
                    _purchases.value = purchaseList
                } else {
                    _purchases.value = emptyList()
                }               

            } 
        }
}

Solution

  • A: Yes, a subscription will be canceled after 6 renewals, similarly to how it is canceled by the user.

    B:

    It seems that _purchases.value will return empty when Google Play cancels a subscription after it reaches the maximum of six renewals in the test environment by Code A.

    In the snippet provided, you're querying currently active products only (i.e., subscriptions that haven't expired and one-time products that haven't been consumed); that's why the list is empty in your case. However, if you call queryHistoryPurchasesAsync(), the result before purchasing that subscription would be different from the one after the purchase.

    Will it appear as if the user never subscribed to the item?

    Therefore, no, it will appear as if the user had the subscription before, but now it's expired.

    C: There are two types of subscriptions – auto-renewable and prepaid (i.e., non-renewable). The former renews infinitely unless canceled or cross-graded to another subscription, while the latter never renews and just expires when its billing period comes to an end.