Skip to content

Commit

Permalink
Update README to make it clear that Babel transpiling is assumed
Browse files Browse the repository at this point in the history
To make it clear to Node n00bs like me that the code above won't work in a plain Node script.

Closes #21

fbshipit-source-id: 3653f5b
  • Loading branch information
fredrivett authored and expbot committed Dec 4, 2018
1 parent 0c9ef0d commit b859b5b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ If you have problems with the code in this repository, please file issues & bug

## Usage

_Note: the following code assumes that you are using JavaScript modules with `import`. If you aren't then you should use the old syntax for the SDK import: `const { Expo } = require('expo-server-sdk')`._

```bash
yarn add expo-server-sdk
```
Expand Down Expand Up @@ -54,7 +56,7 @@ let tickets = [];
// NOTE: If a ticket contains an error code in ticket.details.error, you
// must handle it appropriately. The error codes are listed in the Expo
// documentation:
// https://docs.expo.io/versions/latest/guides/push-notifications#response-format
// https://docs.expo.io/versions/latest/guides/push-notifications#response-format
} catch (error) {
console.error(error);
}
Expand Down Expand Up @@ -105,7 +107,7 @@ let receiptIdChunks = expo.chunkPushNotificationReceiptIds(receiptIds);
console.error(`There was an error sending a notification: ${receipt.message}`);
if (receipt.details && receipt.details.error) {
// The error codes are listed in the Expo documentation:
// https://docs.expo.io/versions/latest/guides/push-notifications#response-format
// https://docs.expo.io/versions/latest/guides/push-notifications#response-format
// You must handle the errors appropriately.
console.error(`The error code is ${receipt.details.error}`);
}
Expand Down

0 comments on commit b859b5b

Please sign in to comment.