Skip to main content
Question

Display Apple Store login prompt when calling syncPurchases on iOS

  • February 14, 2025
  • 1 reply
  • 19 views

Forum|alt.badge.img

Hi all,
In flutter project, we are using the syncPurchases method to automatically sync transactions when users launch the app. However, we are encountering an issue where the login prompt always appears when calling syncPurchases in the sandbox environment. This issue was resolved when I created and logged with Apple Store sandbox account.

The documentation mentions using syncPurchases instead of restorePurchases to perform a silent sync without triggering any prompts. Below is the code snippet we are implementing, which runs when the app launches.

 bool reloadData() async {
    try {
      await Purchases.syncPurchases();
      await fetchProducts();
      return true;
    } catch (e) {
      return false;
    }
  }

I have the following questions:

  1. In what specific cases does calling syncPurchases trigger the login prompt?
  2. In the release version on the App Store (not sandbox), will calling syncPurchases still display the login prompt?

 

Since this is an urgent matter, I hope the team can review and respond as soon as possible.

Thank you!

This post has been closed for comments

1 reply

joan-cardona
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 315 replies
  • February 18, 2025

Hi ​@huunam-d09e3a,

Does this happen through Testflight or through the simulator? Not having the syncPurchases also triggers it or not?

And lastly, does it happen with an account that already made or tried to make purchases or it happens with any Apple account?

 

Best,


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