Hey community, I ran into a problem that I can't solve.
When i execute Purchases.shared.purchase(package: Package) as async throws function, i cant really stop the Task { } higher in the call hierarchy and because of that, when user tap subscribe/buy → Task with Purchases.shared.purchase starts to execute → then user close VC or navigate to another → Task is still continues to execute and shows a system bottom sheet with purchase description, price and buy button, but I'm doing everything to cancel task. But nothing works.
Is there any way to cancel a Task that has already started a RevenueCat system call to the StoreKit system ???
Cancelling Purchases.shared.purchase(package: Package)
Page 1 / 1
Nice, but the question was about something else entirely - it was about Revenue cat API task cancelling, not about disabling UI while operation executing, coz not allowing the user to leave the screen is a bad way of usability Is it possible to cancel entirely running purchase task?
Hey
Before you start a purchase, you should disable your UI or show a loading view, indicating that the purchase is in progress and preventing the customer from navigating away. Once the purchase method completes, you can remove the loading indicator/re-enable the view interaction.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.