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;
}
}