use of com.amazonaws.services.sns.model.SetEndpointAttributesRequest in project krypton-android by kryptco.
the class SNSTransport method registerWithAWS.
public synchronized void registerWithAWS() throws TransportException {
try {
AmazonSNSClient client = getClient();
CreatePlatformEndpointRequest request = new CreatePlatformEndpointRequest().withPlatformApplicationArn(PLATFORM_APPLICATION_ARN).withToken(token);
CreatePlatformEndpointResult result = client.createPlatformEndpoint(request);
setEndpointARN(result.getEndpointArn());
HashMap<String, String> enabledAttribute = new HashMap<>();
enabledAttribute.put("Enabled", "true");
SetEndpointAttributesRequest enableRequest = new SetEndpointAttributesRequest().withEndpointArn(endpointARN).withAttributes(enabledAttribute);
client.setEndpointAttributes(enableRequest);
} catch (AmazonClientException e) {
throw new TransportException(e.getMessage());
}
}
Aggregations