Skip to main content
Solved

Flutter - how to show progress dialog until pay screen loads on button click?

  • December 2, 2021
  • 1 reply
  • 791 views

Forum|alt.badge.img+2

I have 4 buttons in my app for subscription and one time purchases. In android when we click on button its immediately loads pay-screen but in iOS its take some time to show pay wall. How to show a progress dialog until pay wall loads?  

I am using like this below!

onClick: () async{
    await Purchases.purchasePackage(package!);
}

Best answer by cody

Hey @Rajesh!

This behavior may vary from app to app, but in general you can display a loading indicator before calling purchasePackage, then dismissing the loading indicator once your `await` statement completes (after the purchase method returns PurchaserInfo). The method returns the updated PurchaserInfo, so you can go ahead and remove the loading indicator at that time.

The system iOS payment sheet will cover your app’s content, so it’s safe to display a loading indicator when calling that method.

View original
Did this post help you find an answer to your question?
This post has been closed for comments

1 reply

cody
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • 501 replies
  • Answer
  • December 14, 2021

Hey @Rajesh!

This behavior may vary from app to app, but in general you can display a loading indicator before calling purchasePackage, then dismissing the loading indicator once your `await` statement completes (after the purchase method returns PurchaserInfo). The method returns the updated PurchaserInfo, so you can go ahead and remove the loading indicator at that time.

The system iOS payment sheet will cover your app’s content, so it’s safe to display a loading indicator when calling that method.


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