Skip to content

Commit

Permalink
displays error on example
Browse files Browse the repository at this point in the history
  • Loading branch information
vegaro committed Feb 25, 2019
1 parent cf66bfe commit 1e83b35
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,29 @@ export default class App extends Component {
setListeners = () => {
const listeners = {
purchaseListener: (productIdentifier, purchaserInfo, error) => {
if (error && !error.userCancelled) {
if (error && error.userCancelled) {
return;
}
if (error) {
this.setState({ error: error.message });
return;
}
this.handlePurchaserInfo(purchaserInfo);
},
purchaserInfoUpdatedListener: purchaserInfo => {
purchaserInfoUpdatedListener: (purchaserInfo, error) => {
if (error) {
this.setState({ error: error.message });
return;
}
if (purchaserInfo) {
this.handlePurchaserInfo(purchaserInfo);
}
},
restoreTransactionsListener: purchaserInfo => {
restoreTransactionsListener: (purchaserInfo, error) => {
if (error) {
this.setState({ error: error.message });
return;
}
if (purchaserInfo) {
this.handlePurchaserInfo(purchaserInfo);
}
Expand Down

0 comments on commit 1e83b35

Please sign in to comment.