Skip to content

Instantly share code, notes, and snippets.

@brianleroux
brianleroux / wtf-sns-apns.js
Created August 5, 2016 23:00
Send a silent push notification to APNS with AWS SNS.
sns.publish({
TargetArn: device.arn,
MessageStructure: 'json',
Message: JSON.stringify({
default: 'you will never see this muah!',
APNS_SANDBOX: JSON.stringify({
aps: {
'alert': '',
'content-available': 1
},
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split("");
function f() {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1