Skip to main content
Solved

User who canceled subscription can't restore purchase

  • December 21, 2021
  • 2 replies
  • 181 views

Steph
Forum|alt.badge.img+9

We are using Flutter and have an Android user who paid for a monthly subscription Dec 9th and canceled, but their subscription should be active until Jan 9th. They were trying to restore their purchase several times but it seems like restoring just hangs after waiting up to 2 minutes. The success/failure toasts that normally appear don’t seem to be triggering for them. 

Other Android users have been able to restore their purchase successfully.

Are there any known issues for when users have canceled but are in an active subscription state? Pasted our restore purchase code & attached a screenshot of our user’s Google Play subscription screen.

 

Future<bool> restorePurchase(BuildContext context) async {
  final PurchasesErrorCode? code = await requestToRestorePurchases();
  if (code == null) {
    triggerToast(context: context, text: 'Purchase restored!');
    triggerHeavyHaptic();
    return true;
  } else {
    triggerToast(
        context: context, text: 'Could not restore existing subscription.');
    triggerHeavyHaptic();
    return false;
  }
}


Future<PurchasesErrorCode?> requestToRestorePurchases() async {
  logPurchaseAction('purchase restore', {});

  try {
    final PurchaserInfo restoredInfo = await Purchases.restoreTransactions();
    processRestoredPurchaseSubscription(restoredInfo);
    return null;
  } on PlatformException catch (e, stackTrace) {
    final PurchasesErrorCode code = PurchasesErrorHelper.getErrorCode(e);
    if (code == PurchasesErrorCode.purchaseCancelledError) {
      logPurchaseAction('purchase restore cancel', {});
    } else {
      Logger.e(
        error: e,
        stackTrace: stackTrace,
        name: 'Purchase',
        message: 'Failed to restore purchases for $code',
      );
    }

    return code;
  }
}

 

 

Best answer by sharif

If they’re not seeing the success/failure toast in just a few seconds and the process is taking an unusually long time, this may be an issue on their device (e.g. slow network connection, too many background apps, etc.) It doesn’t seem to be widespread either judging from what you’re describing. Have they tried connecting to a different Wifi network and/or restarting the device? That would be my next troubleshooting step for them.

View original
Did this post help you find an answer to your question?

2 replies

sharif
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • 513 replies
  • Answer
  • January 3, 2022

If they’re not seeing the success/failure toast in just a few seconds and the process is taking an unusually long time, this may be an issue on their device (e.g. slow network connection, too many background apps, etc.) It doesn’t seem to be widespread either judging from what you’re describing. Have they tried connecting to a different Wifi network and/or restarting the device? That would be my next troubleshooting step for them.


Steph
Forum|alt.badge.img+9
  • Author
  • Helper
  • 24 replies
  • January 6, 2022

You’re right that it turned out that it works after they restart the app with Wifi on, thanks!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings