Created
November 7, 2017 15:20
-
-
Save tabrindle/08263de276382c82daab55b175e25b2b to your computer and use it in GitHub Desktop.
Expo Notifications Demo - sendPushNotification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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