bizz84 / SwiftyStoreKit

Lightweight In App Purchases Swift framework for iOS 8.0+, tvOS 9.0+ and macOS 10.10+ ⛺
MIT License
6.57k stars 796 forks source link

apple review reject app #655

Open bitcot-jvn opened 3 years ago

bitcot-jvn commented 3 years ago

When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple’s test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code "Sandbox receipt used in production," you should validate against the test environment instead.

sabiland commented 3 years ago

First call AppleReceiptValidator with .production AppleReceiptValidator.VerifyReceiptURLType, if this fails (error), call exactly the same logic with .sandbox type.