0

Here are how my app handles auto-renew subscription

  1. Launch billing flow with BillingClient 1.1 library (BillingClient.launchBillingFlow())
  2. Send purchased detail to backend to handle premium things
  3. Update premium status

If I failed at step 2 (connection error, server dead...), user exited app then open again, how to retrieve owned auto-renew subscription item to notify user that they already bought an item and to do step 2 again?

Thanks.

Wayne
  • 6,361
  • 10
  • 46
  • 69

1 Answers1

0

Answers my own question after 5 days without any answers. To retrieve own auto-renew items, call BillingClient.queryPurchases(BillingClient.SkuType.SUBS) after onBillingClientSetupFinished() then check if is Purchase.isAutoRenewing() = true. Don't use queryPurchaseHistoryAsync() because Purchases return from this method don't have auto-renewing state (always return false). This answer is valid for BillingClient v1.1.

Wayne
  • 6,361
  • 10
  • 46
  • 69