Skip to main content
Question

Are RevenueCat callbacks always on a background thread?


Forum|alt.badge.img+4

Hi all,

I’m setting up subscriptions with RevenueCat and I noticed that `[RCPurchases.sharedPurchases customerInfoWithCompletionHandler:^(RCCustomerInfo * _Nullable info, NSError * _Nullable error) {` will have the completion handler called  a background thread. Is this intended? Are all RevenueCat callbacks on background threads?

 

Do I need to always run `dispatch_async(dispatch_get_main_queue()` after a RevenueCat API?


Thanks!

This post has been closed for comments

2 replies

NachoSoto
Forum|alt.badge.img+5
  • Active Helper
  • 22 replies
  • October 17, 2023

Hello!

That’s not at all intended, so thanks for reporting this. We try to make sure that all our completion blocks are called on the main thread to make the SDK easier to use. However, we can’t fully guarantee this 100% until we’re able to switch to using `@MainActor` everywhere, which we can’t until we drop support for iOS 12.

To help us look into this issue, could you share a few more details with us?

  • SDK version
  • Xcode version
  • Verbose logs (Purchases.logLevel = .verbose)

Thank you!


Forum|alt.badge.img+1
  • New Member
  • 1 reply
  • March 5, 2024

Is there anyway to push this to the background at startup? The main thread gets blocked for an insanely long time on startup and impacts performance


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