diff --git a/Readme.md b/Readme.md index 7e205d4..a6818f1 100644 --- a/Readme.md +++ b/Readme.md @@ -67,7 +67,7 @@ var productIdentifier = 'com.xyz.abc'; 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) { - AlertIOS.alert('Purchase Successful', 'Your Transaction ID is ' + response.transactionIdentifier); + Alert.alert('Purchase Successful', 'Your Transaction ID is ' + response.transactionIdentifier); //unlock store here. } }); @@ -88,19 +88,19 @@ InAppUtils.purchaseProduct(productIdentifier, (error, response) => { ### Restore payments ```javascript -InAppUtils.restorePurchases((error, response)=> { +InAppUtils.restorePurchases((error, response) => { if(error) { - AlertIOS.alert('itunes Error', 'Could not connect to itunes store.'); + Alert.alert('itunes Error', 'Could not connect to itunes store.'); } else { - AlertIOS.alert('Restore Successful', 'Successfully restores all your purchases.'); + Alert.alert('Restore Successful', 'Successfully restores all your purchases.'); - if (response.length == 0) { + if (response.length === 0) { Alert.alert('No Purchases', "We didn't find any purchases to restore."); return; } - response.forEach( function(purchase) { - if (purchase.productIdentifier == "com.xyz.abc") { + response.forEach((purchase) => { + if (purchase.productIdentifier === 'com.xyz.abc') { // Handle purchased product. } }); @@ -127,7 +127,7 @@ iTunes receipts are associated to the users iTunes account and can be retrieved ```javascript InAppUtils.receiptData((error, receiptData)=> { if(error) { - AlertIOS.alert('itunes Error', 'Receipt not found.'); + Alert.alert('itunes Error', 'Receipt not found.'); } else { //send to validation server } @@ -143,9 +143,9 @@ Check if in-app purchases are enabled/disabled. ```javascript InAppUtils.canMakePayments((enabled) => { if(enabled) { - AlertIOS.alert('IAP enabled'); + Alert.alert('IAP enabled'); } else { - AlertIOS.alert('IAP disabled'); + Alert.alert('IAP disabled'); } }); ```