Skip to main content
Solved

RevenueCat.OfferingsManager.Error error 0.) Underlying error: The request timed out..

  • December 9, 2024
  • 2 replies
  • 48 views

Forum|alt.badge.img+2

Apple Review is getting rejected repeatedly due the following error:

 

🍎‼️ Error fetching offerings - The operation couldn’t be completed. (RevenueCat.OfferingsManager.Error error 0.) Underlying error: The request timed out.. 

 

This is only happening on Apple Review devices. I’ve tested in Simulator and various physical devices with different iOS versions and cannot reproduce.

 

Here’s how I initialize RevenueCat:

 

...

Future<void> initRevenueCat(ProviderContainer container) async {
  if (!Platform.isIOS) {
    throw UnsupportedError('Unsupported platform for revenuecat');
  }
  if (kDebugMode) {
    await Purchases.setLogLevel(LogLevel.debug);
  }
  final configuration = PurchasesConfiguration(revenueCatApiKey);
  await Purchases.configure(configuration);
  Purchases.addCustomerInfoUpdateListener((_) {
    container.invalidate(customerInfoProvider);
  });
  Purchases.setLogHandler(revenueCatHandler);
}

...


Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);

  final container = (kProviderDebug)
      ? ProviderContainer(
          observers: [ProviderLogger()],
        )
      : ProviderContainer();

  await initFlutterSettings();
  await initAuth(container);
  await initAnalytics();
  if (defaultTargetPlatform == TargetPlatform.iOS) {
    await initRevenueCat(container);
  }

  runApp(UncontrolledProviderScope(container: container, child: const App()));
}

 

I tried turning off the internet to see if the timeout is because of that but I get a different error in that case -- `Underlying error: Error performing request because the internet connection appears to be offline..` which is expected.

 

I have Firebase Crashlytics enabled and found some interesting things:

  • The error is occurring for “Process State” “background”
  • On the most recent review, one out of the 6 errors was “… internet connection appears to be offline...” but the other 5, and all the reviews before that had the timeout error.

 


 

Is this a known issue?

Should I be initializing RevenueCat differently? Maybe only after I’ve confirmed an internet connection?

Should I add any other artifacts to this post?

Best answer by jeanlucthumm

Hi so for whatever reason, the timeout went away instantly and consistently when I removed the local StoreKit testing file and all references to it.

 

This probably shouldn’t affect a review who is in a sandboxed beta environment (not Xcode development), but it does.

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

2 replies

kaitlin
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 393 replies
  • December 11, 2024

Hey ​@jeanlucthumm,

This can be a tough one to debug if you’re unable to reproduce it on your own devices. Is it possible that the review is located in a different country or region than your app is available in?

Otherwise, it could be that your reviewer has a VPN set up, or may be experiencing network issues or low bandwidth on their end. 

One way to handle this could be, as you said, to alert the user if they seem to be offline - but I think that, as you saw, if they were fully offline the error would be different and instead it seems like their connection may be unstable.

When do you initialize the RevenueCat SDK? We recommend doing so as early in the lifecycle as is feasible.  


Forum|alt.badge.img+2
  • Author
  • Helper
  • 1 reply
  • Answer
  • December 23, 2024

Hi so for whatever reason, the timeout went away instantly and consistently when I removed the local StoreKit testing file and all references to it.

 

This probably shouldn’t affect a review who is in a sandboxed beta environment (not Xcode development), but it does.


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