Created
June 16, 2010 07:17
-
-
Save stammy/440273 to your computer and use it in GitHub Desktop.
Notifo JS example: Send message to user from their own user account
This file contains 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
function sendNotifo(msg,title,uri,label) { | |
var https = new XMLHttpRequest(); | |
var auth = "Basic " + Base64.encode(localStorage.notifo_username+':'+localStorage.notifo_apisecret); | |
var push = 'to=' + encodeURIComponent(localStorage.notifo_username) + '&msg=' + encodeURIComponent(msg) + '&uri=' + encodeURIComponent(uri) + '&label=' + encodeURIComponent(label)+ '&title=' + encodeURIComponent(title); | |
https.open('POST', 'https://api.notifo.com/v1/send_notification', true); | |
https.setRequestHeader('Authorization', auth); | |
https.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); | |
https.send(push); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment