Skip to content
Merged

Typo #105

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
});
Expand All @@ -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.
}
});
Expand All @@ -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
}
Expand All @@ -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');
}
});
```
Expand Down