Using:
For purchasing: react-native-in-app-utils
For validation: iap-receipt-validator
After successfully purchase a subscription, I would like to validate it every time user enters the app.
receiptData returns the correct receipt string.
InAppUtils.receiptData((error, receiptData)=> {
if(error) {
} else {
IOSReceiptValidator.validate(receiptData).then(function (result) {
}).catch(function (error) {
});
}
});
IOSReceiptValidator:
static async validate(receiptData) {
try {
const validationData = await validateReceipt(receiptData);
console.log(validationData);
} catch(err) {
console.log(err.valid, err.error, err.message) // Here is the error
}
}
Validation fails, every time,
Error:
"Failed to execute 'readAsText' on 'FileReader': parameter 1 is not of type 'Blob'."
I've tried to look for other issues with the libraries I'm using, but no issue was found. I'm not sure, but maybe is has something to do with debugging on Chrome? (On Real device, just debugging in Chrome) Anyone has any idea?
Thanks.