Question

Problem with MacOS app.

  • 4 July 2023
  • 3 replies
  • 361 views

Badge +1

I have a SwiftUI app that has iOS and macOS versions. They share the same code except for the the initial OS specific app view as well as user settings view.

All 5 of my in-app purchases are consumables There are no subscription items.

The iOS version of my apps works fine and I have been able to successfully make sandbox purchases. It populates the various purchases on the “purchase screen” and everything works as expected.

The problem is the Mac app. It will not load and populate any purchases. This has me stumped because the code is the exact same code as used in the iOS version. When I run the iOS version of the app, I see no errors at all in the debug window. But when I run the Mac version, I get the following error every few seconds.

2023-07-03 15:10:42.801947-0700 TurboAI[81346:6961607] [Purchases] - ERROR: 🍎‼️ Store products request failed! Error: Error Domain=SKErrorDomain Code=0 "An unknown error occurred" UserInfo={NSLocalizedDescription=An unknown error occurred, NSUnderlyingError=0x600003e4fc90 {Error Domain=ASDErrorDomain Code=500 "(null)" UserInfo={NSUnderlyingError=0x600003e4e790 {Error Domain=AMSErrorDomain Code=203 "Bag Load Failed" UserInfo={NSUnderlyingError=0x600003e4e520 {Error Domain=AMSErrorDomain Code=203 "Bag Load Failed" UserInfo=0x600002513900 (not displayed)}, NSLocalizedFailureReason=Unable to retrieve p2-product-offers-batch-limit because we failed to load the bag., NSLocalizedDescription=Bag Load Failed}}}}}

At one point, it DID populate the purchases but then it stopped. I have no idea why. Any ideas would certainly be appreciated.


3 replies

Userlevel 4
Badge +6

Hey @BrianSB

Unfortunately, this seems to be an Apple specific error and one that we don’t have great insight into why it occurred. It could be worth reaching out to Apple support regarding it. After some research, it seems it could possibly be a network connectivity issue, blocking the app from downloading the required data to validate receipts and load the bag. It could also be a time synchronization issue - the device's clock may be out of sync with the App Store server's clock. It also seems that some people are able to solve the issue just by rebooting their Mac. 

Hopefully something here helps!

Badge +1

Thanks for your reply. I have a very solid commercial internet connection with tons of bandwidth so I don’t think the problems is related to that. Rebooting does correct the problem for awhile. But then it returns.

When I was first working with the RC SDK, I tried using a manual UserID in the Purchases.configure call trying to get things to work. I only tried that once, then reverted back to using anonymous UserIDs.

But, that manual UserID is still being used. The UserID string is not anywhere in my code, and I deleted the “customer” from RevenueCat, but nevertheless, it is still being used. I don’t know where this is stored on my machine and can’t clear it. I think that’s where the problem lies. No matter what I do, when I run it through Xcode, it inserts this UserID in the URL. 

I think if I could somehow delete the stored UserID on my machine, it would resolve the problem/

Userlevel 4
Badge +6

Hey @BrianSB,

Have you changed the sandbox user that you’re testing under? If you haven’t, then most likely the SDK is continuing to link any additional user back to that user id. When that happens, even if you’ve deleted the user, it will recreate them in RevenueCat once they’ve been seen again. 

I’d recommend checking the Apple ID that’s logged into your Macbook, and possibly try creating a brand new sandbox user and logging them in.

Reply