Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When do android app get the "Expired" status after canceling the subscription during the trial period

There is a "Subscription with Free Trial" in my android app, and the BillingService would get the Purchased status after buying subscription product.

But, the BillingService does not get the Expired status after canceling the subscription.

However, accroding to Android Developer,

"If necessary, the user can cancel the subscription at any time during the trial period. In this case, Google Play marks the subscription as expired immediately, rather than waiting until the end of the trial period."

but My app does not get the status.

I wonder that When does android app get the "Expired" status after canceling the subscription during the trial period.

like image 608
Reiny Song Avatar asked Dec 21 '12 04:12

Reiny Song


2 Answers

I've noticed this too. In my case the purchase state only changed at the end of the (7-day) trial period even though I cancelled within minutes of purchasing the trial subscription.

I'm currently waiting for another cancelled trial to expire - it's been 3 days now and the purchase state is still 0 ("purchased successfully").

Update: So it seems you either need to restore transactions periodically (Google says you should not do this "because of performance impacts") or you need a web-server with code to check the subscription details using the the server-side API http://developer.android.com/google/play/billing/v2/billing_subscriptions.html#play-dev-api. Your app would then query your web-server which would only check with Google's services when the expiry date has been reached.

like image 171
Carlos da Costa Avatar answered Oct 23 '22 13:10

Carlos da Costa


I have tested this case in a non-test environment, i.e. productive environment.

I received a ACTION_PURCHASE_STATE_CHANGED notification with EXPIRED state some 4 hours after cancelling the subscription. (I've cancelled the subscription a few minutes after the purchase. Trial period is 7 days)

Trying to re-purchase the subscription after the EXPIRED notification returned "Already owned" a couple of times, and after that I was able to re-purchase (without the trial period, as documented).

I do not have the Google server API implemented, so I don't know what would the status be. However, on the Merchant site, the order and the Order CSV download show the item as CHARGED.

So, what has changed since the previous answer?

  1. Productive environment vs Google test environment
  2. Possibly a Google bug fix

Once I implement the Google server API query, I will update this answer.

UPDATE:

I have implemented the Google Server API check, and it shows correctly that the subscription was cancelled a few minutes after the purchase. This API check was done 3 days after purchase, well within the 7 days trial.

My conclusion at this point in time is that user cancellations within the trial period are handled correctly by Google.

like image 41
OferR Avatar answered Oct 23 '22 13:10

OferR