Sandbox environment extremely unreliable

I have two sandbox users in App Store Connect, as I'm trying to test in-app purchases and Family Sharing. They're set up fine; I can make purchases in the app.

The issue is that the refund request sheet in my app sometimes shows properly and lets me request a refund, but I'd say >80% of the time the sheet just shows "Cannot Connect" with a "Retry" button. Hitting that button doesn't ever result in the sheet showing the refund page.

The only fix for this is to delete the app from the device, and restart the device.

This has to be a joke, right? I need to be able to test this IAP, and the sandbox environment is useless most of the time. Why?

Anyone experiencing this sort of issue?

Answered by darkpaw in 822230022

Just ranting to myself since barely anyone responds to my questions on here.

I can't get Family Sharing to work properly.

If I purchase on one device in one sandbox account, it doesn't appear on the other device in the other sandbox account unless I kill the app and relaunch it. The listener task (taken from the FoodTruckBuildingASwiftUIMultiplatformApp sample code) doesn't seem to actually trigger at all, and it's not obvious how to get it to trigger. The Developer session videos for StoreKit2 say to listen for transaction updates on app launch, but the sample code (mentioned above) doesn't do anything of the sort.

Honestly, I wish Apple would provide sample code that does ONE thing at a time, and has comments in it.

Not everyone is writing an app that has every type of in-app purchase, so some sample code that shows non-consumable purchases would be great. Then another showing consumables. Then another showing subscriptions, etc. By all means put it all together in one app, too, but help us out here!

When you bunch everything into one sample app it becomes extremely difficult to follow what's going on, and if we have to cut out the bits we don't need, how do we know we aren't removing something we actually do need?

It gets so frustrating trying to write code for Apple's platforms. I'm not stupid, I write code all day, but some of this stuff is so poorly documented that it drives us away from these platforms.

Accepted Answer

Just ranting to myself since barely anyone responds to my questions on here.

I can't get Family Sharing to work properly.

If I purchase on one device in one sandbox account, it doesn't appear on the other device in the other sandbox account unless I kill the app and relaunch it. The listener task (taken from the FoodTruckBuildingASwiftUIMultiplatformApp sample code) doesn't seem to actually trigger at all, and it's not obvious how to get it to trigger. The Developer session videos for StoreKit2 say to listen for transaction updates on app launch, but the sample code (mentioned above) doesn't do anything of the sort.

Honestly, I wish Apple would provide sample code that does ONE thing at a time, and has comments in it.

Not everyone is writing an app that has every type of in-app purchase, so some sample code that shows non-consumable purchases would be great. Then another showing consumables. Then another showing subscriptions, etc. By all means put it all together in one app, too, but help us out here!

When you bunch everything into one sample app it becomes extremely difficult to follow what's going on, and if we have to cut out the bits we don't need, how do we know we aren't removing something we actually do need?

It gets so frustrating trying to write code for Apple's platforms. I'm not stupid, I write code all day, but some of this stuff is so poorly documented that it drives us away from these platforms.

Sandbox environment extremely unreliable
 
 
Q