Skip to content

Instantly share code, notes, and snippets.

@ajcrites
Created June 30, 2016 14:48
Show Gist options
  • Save ajcrites/f5693f65a6e0b2da2c96a1926c680257 to your computer and use it in GitHub Desktop.
Save ajcrites/f5693f65a6e0b2da2c96a1926c680257 to your computer and use it in GitHub Desktop.
sns.createPlatformEndpointAsync({
PlatformApplicationArn: applicationArn,
Token: deviceId,
});
/* send the notification (not needed) */
sns.publishAsync({
MessageStructure: "json",
Message: JSON.stringify({
APNS: JSON.stringify({
aps: messageJson
}),
TargetArn: deviceArn,
});
/* subscribe device to topic */
sns.subscribeAsync({
Protocol: 'application',
TopicArn,
// Acquired from `createPlatformEndpoint`
Endpoint,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment