Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. sns.createPlatformEndpointAsync({
  2. PlatformApplicationArn: applicationArn,
  3. Token: deviceId,
  4. });
  5.  
  6. /* send the notification (not needed) */
  7. sns.publishAsync({
  8. MessageStructure: "json",
  9. Message: JSON.stringify({
  10. APNS: JSON.stringify({
  11. aps: messageJson
  12. }),
  13. TargetArn: deviceArn,
  14. });
  15.  
  16. /* subscribe device to topic */
  17. sns.subscribeAsync({
  18. Protocol: 'application',
  19. TopicArn,
  20. // Acquired from `createPlatformEndpoint`
  21. Endpoint,
  22. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement