Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@moduscreate
Created February 16, 2018 18:44
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 moduscreate/62e1143f13433e911d1b22ae506c55a5 to your computer and use it in GitHub Desktop.
Save moduscreate/62e1143f13433e911d1b22ae506c55a5 to your computer and use it in GitHub Desktop.
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