AppStore.sync() fails with StoreKitError.unknown in TestFlight, while products and verified entitlements load correctly

Hello,

I’m investigating a persistent StoreKit 2 restoration issue in My Drop Music. I would appreciate help identifying the cause or collecting more useful diagnostics.

Environment:

  • iPhone 17, iOS 26.6.2
  • TestFlight version 6.22.60 (62260.12)
  • Transaction environment: Sandbox
  • Storefront: USA, currency: USD

What works:

  • Product.products(for:) returns both expected non-consumable products.
  • The full-unlock product returns a price of USD 6.99.
  • The free trial product returns a price of 0.
  • Transaction.currentEntitlements returns verified transactions for both products, with no unverified transactions reported.
  • The app recognizes full access.

What fails:
When I tap “Restore purchases,” AppStore.sync() fails with StoreKitError.unknown. An Apple authentication prompt appears during restoration, but the operation still fails after submitting credentials.

Latest diagnostic output:

My Drop Music 6.22.60 (62260.12)
iOS 26.6.2
Storefront=USA; currency=USD
AppStore.sync=failed
Kind: StoreKitError.unknown
Reference: StoreKit.StoreKitError:2
Before: cached app state: full=true; trialPresent=true
After: full=1; trial=1; unverified=0; environment=Environment(rawValue: “Sandbox”)

Tests already performed:

  • Reproduced over both Wi-Fi and cellular.
  • Signed out of and back into Media & Purchases.
  • Modified the restoration flow so AppStore.sync() is the first awaited operation after the user taps Restore. Entitlement and storefront diagnostics are collected afterward. The failure persists.
  • Created a separate Sandbox tester. Attempting authentication with that tester produced a system alert saying “Verification Failed — An unknown error occurred.” I have not established whether that is the same underlying issue.

I currently have only one iPhone available for testing.

Does this pattern suggest any specific account, device, or integration checks? Which device logs or additional error details would help distinguish a Sandbox authentication issue from an app integration issue?

I am not assuming this is an Apple bug; I’m trying to determine the cause.

Thank you!

Update: purchasing and restoring full access now work in my TestFlight build.

What worked in my testing:

  1. Cleared the Sandbox tester’s purchase history in App Store Connect.
  2. Signed out of Media & Purchases on the iPhone, while keeping iCloud signed in.
  3. Signed in with the Sandbox tester under Settings → Developer → Sandbox Apple Account.
  4. Completed a new Sandbox purchase, then tested Restore Purchases.

The restore diagnostics now report:
AppStore.sync=success
full=1; unverified=0
environment=Sandbox

Clearing the purchase history removes previous test purchases, so a new purchase was needed before testing restoration.

I cannot isolate which step resolved the original error, but this sequence worked on my device. The separate pricing discrepancy remains: the Canadian purchase sheet shows CAD, while Product.products returns USD.

Thank you for your help!