I'm trying to validate the receipt of a auto-renewable subscription on App Store according to this : https://developer.apple.com/documentation/storekit/in-app_purchase/validating_receipts_with_the_app_store
I'm using React Native with this module to make the purchase : https://github.com/dooboolab/react-native-iap
Here's my code :
if (Platform.OS === 'ios') { console.log('PURCHASE IOS IS DONE'); console.log('Transaction Receipt', JSON.stringify({ transaction: purchase })); RNIap.getReceiptIOS().then(async result => { console.log('Purchase Receipt', result); });}
The variable result gives me this purchaseReceipt :
MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwGggCSABIIBbTGCAWkwDwIBAAIBAQQHDAVYY29kZTALAgEBAgEBBAMCAQAwFQIBAgIBAQQNDAtuZWFydHJpcC5pbzAPAgEDAgEBBAcMBTIuMS4yMBACAQQCAQEECOG5uScNAAAAMBwCAQUCAQEEFELyZOL0JTlhofkxQmPT76dFJFO6MAoCAQgCAQEEAhYAMCICAQwCAQEEGhYYMjAyMC0wOS0yM1QxNjowNzozOCswMjAwMIGcAgERAgEBBIGTMYGQMAwCAgalAgEBBAMCAQEwGgICBqYCAQEEEQwPcHJlbWl1bV9tZW5zdWVsMAwCAganAgEBBAMMATAwIwICBqgCAQEEGhYYMjAyMC0wOS0yMlQxMTo0NTo0OSswMjAwMCMCAgasAgEBBBoWGDIwMjAtMTAtMjJUMTE6NDU6NDkrMDIwMDAMAgIGtwIBAQQDAgEAMCICARUCAQEEGhYYNDAwMS0wMS0wMVQwMTowMDowMCswMTAwAAAAAAAAoIIDeDCCA3QwggJcoAMCAQICAQEwDQYJKoZIhvcNAQELBQAwXzERMA8GA1UEAwwIU3RvcmVLaXQxETAPBgNVBAoMCFN0b3JlS2l0MREwDwYDVQQLDAhTdG9yZUtpdDELMAkGA1UEBhMCVVMxFzAVBgkqhkiG9w0BCQEWCFN0b3JlS2l0MB4XDTIwMDQwMTE3NTIzNVoXDTQwMDMyNzE3NTIzNVowXzERMA8GA1UEAwwIU3RvcmVLaXQxETAPBgNVBAoMC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GCWCGSAFlAwQCAQUAMA0GCSqGSIb3DQEBCwUABIIBAGWKp8uaHfNBrVrXEqxS3fjsskoTHPKdTi3bXsGg1X4xEeSh5HWuYTeQ9wZMjq/qJwVz4rtJUGP6Cmk7wvPwNWAM772O+D8PeRjVGAwmzRyllslzDh/m05eTNSKBRLT/cKLs+ygU441L12Nh8JG19YB4HCoE6ccrqh+TBKIcu+StapzqUy/RRpTTcLIQjtAzm90Fr7/Ku1ZSqbkHSMNG5UoqTSOgx8YGYWOObM+BDWY55xcLUKYY7IuhUyu5LzjL6zcPjrTulIWPWtU14Id8aDx91dqriT1bQycqKJ1YlcpIjF7JdtQul35IWBErzQ1Hp01rWkvDKNOTWqIo60SVUysAAAAAAAA=
When I'm trying to send it through postman or any other way, the Apple response is forever :
{"status": 21002,}
And yes I add the password field with my shared secret key to the request.
I know it means that the current receipt is mal-formatted or something but I don't know what do to with it as it seems already to be base64 encoded.
Any idea ?