com.amazonaws.services.sns.model.CreatePlatformEndpointResult Java Examples

The following examples show how to use com.amazonaws.services.sns.model.CreatePlatformEndpointResult. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ArnEndpointHandler.java    From ETSMobile-Android2 with Apache License 2.0 5 votes vote down vote up
private void createEndpoint() {
    try {
        SecurePreferences.Editor editor = securePreferences.edit();
        CreatePlatformEndpointRequest request = new CreatePlatformEndpointRequest()
                .withPlatformApplicationArn(this.applicationArn)
                .withToken(this.token)
                .withCustomUserData(this.userData);
        CreatePlatformEndpointResult createResult = client.createPlatformEndpoint(request);

        Log.i("CreateResult", createResult.toString());
        editor.putString(Constants.SNS_ARN_ENDPOINT, createResult.getEndpointArn()).apply();
    } catch (AmazonClientException ace) {
        ace.printStackTrace();
    }
}
 
Example #2
Source File: PushSnsService.java    From oxAuth with MIT License 5 votes vote down vote up
public String createPlatformArn(AmazonSNS snsClient, String platformApplicationArn, String token, User user) {
	CreatePlatformEndpointRequest platformEndpointRequest = new CreatePlatformEndpointRequest();
	platformEndpointRequest.setPlatformApplicationArn(platformApplicationArn);
	platformEndpointRequest.setToken(token);
	
	String customUserData = getCustomUserData(user);
	platformEndpointRequest.setCustomUserData(customUserData);
	
	CreatePlatformEndpointResult platformEndpointResult = snsClient.createPlatformEndpoint(platformEndpointRequest);

	return platformEndpointResult.getEndpointArn();
}
 
Example #3
Source File: PlatformApplicationImpl.java    From aws-sdk-java-resources with Apache License 2.0 5 votes vote down vote up
@Override
public PlatformEndpoint createPlatformEndpoint(CreatePlatformEndpointRequest
        request, ResultCapture<CreatePlatformEndpointResult> extractor) {

    ActionResult result = resource.performAction("CreatePlatformEndpoint",
            request, extractor);

    if (result == null) return null;
    return new PlatformEndpointImpl(result.getResource());
}
 
Example #4
Source File: PlatformApplication.java    From aws-sdk-java-resources with Apache License 2.0 2 votes vote down vote up
/**
 * Performs the <code>CreatePlatformEndpoint</code> action and use a
 * ResultCapture to retrieve the low-level client response.
 *
 * <p>
 * The following request parameters will be populated from the data of this
 * <code>PlatformApplication</code> resource, and any conflicting parameter
 * value set in the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>PlatformApplicationArn</code></b>
 *         - mapped from the <code>Arn</code> identifier.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @return The <code>PlatformEndpoint</code> resource object associated with
 *         the result of this action.
 * @see CreatePlatformEndpointRequest
 */
PlatformEndpoint createPlatformEndpoint(CreatePlatformEndpointRequest
        request, ResultCapture<CreatePlatformEndpointResult> extractor);