Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const maybeAcknowledgePurchaseAndroid = async (purchase: ProductPurchase) => {
if (requiresAcknowledging(purchase)) {
try {
// TODO check the response!
return !!(await acknowledgePurchaseAndroid(
purchase.purchaseToken || '', // if it's not set then set to empty string which will fail
))
} catch (ackErr) {
console.warn('ackErr', ackErr)
return false
}
}
return true
}