Example usage for com.amazonaws.services.sns AmazonSNS createPlatformEndpoint

List of usage examples for com.amazonaws.services.sns AmazonSNS createPlatformEndpoint

Introduction

In this page you can find the example usage for com.amazonaws.services.sns AmazonSNS createPlatformEndpoint.

Prototype

CreatePlatformEndpointResult createPlatformEndpoint(
        CreatePlatformEndpointRequest createPlatformEndpointRequest);

Source Link

Document

Creates an endpoint for a device and mobile app on one of the supported push notification services, such as FCM and APNS.

Usage

From source file:com.easarrive.aws.plugins.common.service.impl.SNSService.java

License:Open Source License

/**
 * {@inheritDoc}/*www  .j  a v  a2  s  .  co  m*/
 */
@Override
public CreatePlatformEndpointResult createPlatformEndpoint(AmazonSNS client,
        SNSPlatformEndpointRequest platformEndpointRequest) {
    if (platformEndpointRequest == null) {
        return null;
    }
    CreatePlatformEndpointRequest createPlatformEndpointRequest = new CreatePlatformEndpointRequest();
    createPlatformEndpointRequest.setCustomUserData(platformEndpointRequest.getCustomUserData());
    createPlatformEndpointRequest
            .setPlatformApplicationArn(platformEndpointRequest.getPlatformApplicationArn());
    createPlatformEndpointRequest.setToken(platformEndpointRequest.getToken());
    createPlatformEndpointRequest.withAttributes(platformEndpointRequest.getAttributes());

    CreatePlatformEndpointResult result = client.createPlatformEndpoint(createPlatformEndpointRequest);
    return result;
}