Skip to main content
Answer

Purchases.shared.paymentDiscount is VERY slow

  • October 3, 2021
  • 1 reply
  • 167 views

Forum|alt.badge.img+1

Why is the Purchases.shared.paymentDiscount function taking so long to complete? The completion is called about 30 sec after the function is called. 

Best answer by ryan

It’s not uncommon for some Apple APIs to get pretty clunky in sandbox - this includes fetching products, making or restoring purchases, generating payment discounts, etc. I’ve never seen any timeout periods so requests can take minutes sometimes - in production things tend to be much quicker. 

Since certain requests need to go through system level iOS APIs, such as this one, there’s unfortunately not much developers can do to speed things up or work around it but I wouldn’t worry too much about the speed of these requests in sandbox. 

This post has been closed for comments

1 reply

ryan
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • Answer
  • October 5, 2021

It’s not uncommon for some Apple APIs to get pretty clunky in sandbox - this includes fetching products, making or restoring purchases, generating payment discounts, etc. I’ve never seen any timeout periods so requests can take minutes sometimes - in production things tend to be much quicker. 

Since certain requests need to go through system level iOS APIs, such as this one, there’s unfortunately not much developers can do to speed things up or work around it but I wouldn’t worry too much about the speed of these requests in sandbox.