Open
Description
Hi, everyone:
this code snippet was copied from my project.
InAppUtils.purchaseProduct(productId, (purchaseError: Error, transaction: IProductTransaction) => {
if (purchaseError) {
//TODO purcuase error?
}
});
and this code snippet was copied from react-native-in-app-utils
README.MD file
InAppUtils.purchaseProduct(productIdentifier, (error, response) => {
// NOTE for v3.0: User can cancel the payment which will be available as error object here.
if(response && response.productIdentifier) {
Alert.alert('Purchase Successful', 'Your Transaction ID is ' + response.transactionIdentifier);
//unlock store here.
}
});
so my question is:
- can I change the logic from
if (purchaseError)
toif(!(response && response.productIdentifier))
Metadata
Metadata
Assignees
Labels
No labels