CloudKit公共数据库:TestFlight与App Store测试问题咨询
Hey Rob, let's walk through the most likely hurdles you're hitting when testing redemption codes for your app—especially since it's passed Apple's review but isn't live yet, and relies on CloudKit to pull in-app purchase IDs. Here are the key areas to check:
1. Redemption Codes Require a "Ready for Sale" App State
Apple's redemption codes typically don't work until your app is marked as Ready for Sale in App Store Connect, even if it's already passed review. If your app is still in the "Pending Release" state:
- Head to App Store Connect > Your App > Pricing and Availability
- Set your release date to a future date (so it doesn't go live early) and toggle the app to Ready for Sale
- This activates the production environment for your app and its associated in-app purchases, allowing redemption codes to function.
2. CloudKit Production Record Sync Delays
Even if you've configured your in-app purchase IDs in the CloudKit Production Console, there might be a sync lag:
- Double-check the CloudKit Production Dashboard to confirm all your IAP IDs are saved correctly and marked as active
- Add debug logging in your app to print the list of IAP IDs pulled from CloudKit—verify they match exactly what's in the console
- Force quit and restart your app to ensure it fetches the latest production records (sometimes cached data can cause mismatches)
3. Mismatched Redemption Code & IAP Project Details
Small mismatches here can break redemption entirely:
- Confirm the redemption code is linked to the exact same IAP ID stored in CloudKit (pay attention to case sensitivity and any prefixes/suffixes)
- Check that the redemption code's IAP type matches what your app is displaying (e.g., don't try to redeem a consumable code for a non-consumable IAP)
- Verify the IAP itself is marked as Approved/Ready for Sale in App Store Connect—even if your app passed review, individual IAPs might still need final activation
4. Sandbox vs Production Environment Conflicts
TestFlight uses the sandbox environment, but redemption codes are tied to production:
- Make sure you're not signed into a sandbox Apple ID when testing redemption codes (sandbox accounts can't use production redemption codes)
- Use a regular, non-sandbox Apple ID that's in the same region as your app's availability settings
5. Regional Restrictions on Redemption Codes
If you set geographic limits when creating the redemption code, your test Apple ID might be excluded:
- Go to App Store Connect > Your App > In-App Purchases > Select the IAP > Redemption Codes
- Check the "Availability" section to ensure your test region is included
Pro Tip for Debugging
If you're still stuck, connect your test device to Xcode and open the Console tab. Filter for StoreKit logs—you'll get specific error messages (like "Invalid redemption code" or "IAP not found") that will point you directly to the issue.
内容的提问来源于stack exchange,提问作者Rob

