-
-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Hey, I'm struggling with server-side receipt validation and could use some help.
I've been trying to validate receipts on my backend by sending the transactionReceipt to Apple's /verifyReceipt endpoint, but I keep getting error 21002 (malformed receipt). The receipt data looks like this: {"transactionId":"123","originalTransactionId":"456"...} - which seems like it's already parsed JSON rather than the base64 receipt blob Apple expects.
Looking at the repo examples, I don't see any server-side validation happening - just client-side purchase handling. Is that intentional?
A few questions:
- Do you have any examples of proper server-side validation with expo-iap?
- With StoreKit 2, do we even need to hit Apple's servers anymore, or can we validate the JWTs locally?
- How do I tell if I'm getting StoreKit 1 receipts vs StoreKit 2 JWTs from expo-iap?
I'm also dealing with the app making tons of validation requests on startup (like 25+), which is probably a separate issue on my end, but wondering if there's a recommended pattern for when/how often to validate.
Any pointers would be awesome. Thanks!