Created
June 30, 2016 14:48
-
-
Save ajcrites/f5693f65a6e0b2da2c96a1926c680257 to your computer and use it in GitHub Desktop.
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
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