Skip to main content
Answer

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

  • December 2, 2021
  • 1 reply
  • 831 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.

This post has been closed for comments

1 reply

cody
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • 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.