StoreKit AppStore.sync throws userCancelled when there is no network

I have a button to restore purchases in my app. It calls AppStore.sync() as suggested by sample code. I'm testing in the sandbox, I put my device in airplane mode, and it throws StoreKitError.userCancelled. That's odd. Anyone else see this?

I'd like to show an error alert popup to the user here, but I can't differentiate between this an a real userCancelled.

Post not yet marked as solved Up vote post of rnikander Down vote post of rnikander
1k views

Replies

I can confirm this issue occurs with a StoreKit configuration file, in debug mode run from Xcode, TestFlight, and in the production App Store environment. 😕

FB12107567 StoreKit 2: AppStore.sync() unexpectedly throws StoreKitError.userCancelled when a network error occurs