Hey @dkjack ,
Thanks for reaching out!To help diagnose this, could you provide:
- A few App User IDs where you're seeing restoration fail (you can find these in the RevenueCat dashboard or SDK logs)
- SDK debug logs for the restore attempt - enable debug logs and share what you see when a user tries to restore
You mentioned using syncPurchases() - here's how that compares to restorePurchases():
syncPurchases()
- sends the current device's App Store receipt to RevenueCat
- only syncs purchases for whoever is currently logged into the App Store on that device
- good for one-time migration tasks
More context here
restorePurchases()
- does everything
syncPurchases() does, plus links the current user to any previous RevenueCat user who owned these same purchases - this is what you want users to call when they tap "Restore Purchases" in your app
- handles the "I reinstalled the app" or "I'm on a new device" scenarios
More context here
Since you're migrating from SwiftyStoreKit (where RevenueCat hasn't seen these purchases before), you should use restorePurchases() instead of syncPurchases(). This ensures RevenueCat properly links the purchases to the user's account.
We recommend that the restorePurchases() action, since it should be User started, should live inside a Paywall or/and from your own (e.g Setting) app screen.
TestFlight uses Apple's sandbox environment, which can behave differently than production:
- If you purchased a subscription in a production version of your app, it may not appear when testing in TestFlight (different environments)
- For testing, make a fresh subscription purchase within TestFlight itself, then try restoring
As for production users being affected, this will most likely no occur - your production users will be in the same environment (production App Store) with the same Apple ID, so restoration should work smoothly. The TestFlight issue you're seeing is probably environment-related.
But feel free to send those over, either here or via our support channel (and link this thread there for extra context too): https://app.revenuecat.com/settings/support?tab=contact
Thanks,