Skip to content

Instantly share code, notes, and snippets.

@tabrindle
Created November 7, 2017 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tabrindle/08263de276382c82daab55b175e25b2b to your computer and use it in GitHub Desktop.
Save tabrindle/08263de276382c82daab55b175e25b2b to your computer and use it in GitHub Desktop.
Expo Notifications Demo - sendPushNotification
sendPushNotification(token = this.state.token, title = this.state.title, body = this.state.body) {
return fetch('https://exp.host/--/api/v2/push/send', {
body: JSON.stringify({
to: token,
title: title,
body: body,
data: { message: `${title} - ${body}` },
}),
headers: {
'Content-Type': 'application/json',
},
method: 'POST',
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment