Skip to main content
Question

Unexpected error when calling restorePurchases with Keep with original App User ID

  • August 24, 2025
  • 4 replies
  • 240 views

Forum|alt.badge.img

Hello everyone :)

The behavior I describe below happens in open testing.

Context:
I’m using RevenueCat for subscriptions in my Flutter app.
Users must have an account linked to my backend in order to subscribe.
That’s why I’m using the option “Keep with original App User ID” in RevenueCat.
Since the stores require a “Restore Purchases” button, I added one, and on click I run:

final user = await Purchases.restorePurchases();


Problem:
Each time I click on my restore purchases button, I get this error:

PlatformException(7, There is already another active subscriber using the same receipt., {message: There is already another active subscriber using the same receipt., readableErrorCode: RECEIPT_ALREADY_IN_USE, code: 7, underlyingErrorMessage: There is already another active subscriber using the same receipt., readable_error_code: RECEIPT_ALREADY_IN_USE}, null)


Which has no sens because, if the user tries to purchase a subscription, the payment modal does show up, and they can successfully subscribe to the app.


What I would like:

  • Ideally, I want to get PlatformException error code 7 only if the user logged into my app actually already has a subscription on their current Apple/Google account, so that I can explicitly tell them that another app account already owns a subscription and they should contact us if they lost access to that account.

  • Otherwise, I would like to simply display a message saying that there is no existing Apple/Google account with an active subscription.

Question:
Do you know why I’m seeing this inconsistent behavior—where restorePurchases tells me the Apple/Google account already has a subscription (even though it doesn’t), while making a new subscription purchase works fine?

I’ve attached the code I use both for restore purchases and for purchasing a subscription.
Thank you for your help :)


// Restore purchase code 

_isLoadingRestore.value = true;
try {
final user = await Purchases.restorePurchases();
if (user.activeSubscriptions.isEmpty && context.mounted) {
showSnackBar(context, s.noActivePurchasesFound, durationInSeconds: 5);
}
} on PlatformException catch (e) {
if (e.code == '7') {
if (context.mounted) {
showSnackBar(context, s.subscriptionAlreadyUsedMessage);
return;
}
} else {
if (context.mounted) {
showSnackBar(context, s.errorGeneric);
}
}
} catch (e) {
if (context.mounted) {
showSnackBar(context, s.errorGeneric);
}
} finally {
_isLoadingRestore.value = false;
});
}

// Subscribe code

 _isLoading.value = true;

  final package = widget.offers.firstWhereOrNull(

    (element) => element.identifier == _selectedOfferId,

  );



  if (package == null) {

    _isLoading.value = false;

    return;

  }



  await Purchases.purchaseStoreProduct(

    package.storeProduct,

  );



  _isLoading.value = false;



  if (mounted) {

    await showDialog<void>(

      context: context,

      barrierDismissible: false,

      builder: (BuildContext context) {

        return const RefreshUserLoadingWidget();

      },

    );

  }

  await ref.read(userProvider.notifier).fetchUser();

} catch (e) {

  _isLoading.value = false;

  logger.e(e);

}

 

This post has been closed for comments

4 replies

joan-cardona
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • August 27, 2025

Hi ​@tuyopass,

When you say: 

Users must have an account linked to my backend in order to subscribe.

Do you allow anonymous users in the app or do you set up the RevenueCat SDK with the custom app user id already?

Do see the same behavior when you try the flow with a newly created sandbox Apple test account?

Best,


Forum|alt.badge.img
  • Author
  • New Member
  • August 27, 2025

Hi ​@joan-cardona 

Thank you for your answer.

When a user logs into their account (connected to my backend), I retrieve their user ID (from my backend) and also log them into RevenueCat with that same ID (await Purchases.logIn(user.id ?? '')).
This way, when my backend receive the subscription success webhook, it can correctly identify which user purchased the subscription.

I tested this by creating a new account in the app (with a brand new user ID), but I still have the same issue: the restore process throw an exception that tells me that I already have an active subscription. However, if I try to purchase a subscription, it actually lets me do it (the payment modal does show up)

This behavior happens in closed testing but also when I run the app in release mode on my Android device.

Thank you for your help !
 


Forum|alt.badge.img
  • Author
  • New Member
  • September 2, 2025

Hi :)

I’m looking to publish my app to production soon and this is blocking me, so a quick response would be incredibly helpful.

Thank you so much in advance for your time and support!
Best regards,
 


alejandra-wetsch
RevenueCat Staff
Forum|alt.badge.img+6

Hey ​@tuyopass

Thank you for the extra details provided!

To provide additional context, the restore functionality looks at historical receipts on the Google account set up on your device. If any receipt from your app was previously linked to a different RevenueCat App User ID, the `restorePurchase` method will throw `RECEIPT_ALREADY_IN_USE`, because your restore behavior is set to “Keep with original App User ID”.  

To troubleshoot further, could you please share the following: 

  • App User IDs that are having this issue
  • Screen recording of your current flow to get this error
  • Full RevenueCat debug logs from the moment the SDK gets configured.
  • Are you always using the same Store Account on your device?
    • Have you tried using a different Store Account and App User ID?
  • Are the products you’re trying to buy after restore fail on the same base plan?

Thank you!