• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CreatePlatformEndpointResult类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.amazonaws.services.sns.model.CreatePlatformEndpointResult的典型用法代码示例。如果您正苦于以下问题:Java CreatePlatformEndpointResult类的具体用法?Java CreatePlatformEndpointResult怎么用?Java CreatePlatformEndpointResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CreatePlatformEndpointResult类属于com.amazonaws.services.sns.model包,在下文中一共展示了CreatePlatformEndpointResult类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createPlatformEndpoint

import com.amazonaws.services.sns.model.CreatePlatformEndpointResult; //导入依赖的package包/类
private CreatePlatformEndpointResult createPlatformEndpoint(
		Platform platform, String customData, String platformToken,
		String applicationArn) {
	CreatePlatformEndpointRequest platformEndpointRequest = new CreatePlatformEndpointRequest();
	platformEndpointRequest.setCustomUserData(customData);
	String token = platformToken;
	String userId = null;
	if (platform == Platform.BAIDU) {
		String[] tokenBits = platformToken.split("\\|");
		token = tokenBits[0];
		userId = tokenBits[1];
		Map<String, String> endpointAttributes = new HashMap<String, String>();
		endpointAttributes.put("UserId", userId);
		endpointAttributes.put("ChannelId", token);
		platformEndpointRequest.setAttributes(endpointAttributes);
	}
	platformEndpointRequest.setToken(token);
	platformEndpointRequest.setPlatformApplicationArn(applicationArn);
	return snsClient.createPlatformEndpoint(platformEndpointRequest);
}
 
开发者ID:tonchidot,项目名称:aws-java-sns-mobile-push-sample,代码行数:21,代码来源:AmazonSNSClientWrapper.java


示例2: demoNotification

import com.amazonaws.services.sns.model.CreatePlatformEndpointResult; //导入依赖的package包/类
private void demoNotification(Platform platform, String principal,
        String credential, String platformToken, String applicationName){
    // Create Platform Application. This corresponds to an app on a platform.
    CreatePlatformApplicationResult platformApplicationResult = createPlatformApplication(
            applicationName, platform, principal, credential);
    System.out.println(platformApplicationResult);

    // The Platform Application Arn can be used to uniquely identify the Platform Application.
    String platformApplicationArn = platformApplicationResult.getPlatformApplicationArn();

    // Create an Endpoint. This corresponds to an app on a device.
    CreatePlatformEndpointResult platformEndpointResult = createPlatformEndpoint(
            "CustomData - Useful to store endpoint specific data", platformToken, platformApplicationArn);
    System.out.println(platformEndpointResult);

    // Publish a push notification to an Endpoint.
    PublishResult publishResult = publish(platformEndpointResult.getEndpointArn(), platform);
    System.out.println("Published.  MessageId="+ publishResult.getMessageId());
    // Delete the Platform Application since we will no longer be using it.
    deletePlatformApplication(platformApplicationArn);
}
 
开发者ID:daffodilistic,项目名称:aws-snsmobilepush,代码行数:22,代码来源:SNSMobilePush.java


示例3: demoNotification

import com.amazonaws.services.sns.model.CreatePlatformEndpointResult; //导入依赖的package包/类
public void demoNotification(Platform platform, String principal,
		String credential, String platformToken, String applicationName,
		Map<Platform, Map<String, MessageAttributeValue>> attrsMap) {
	// Create Platform Application. This corresponds to an app on a
	// platform.
	CreatePlatformApplicationResult platformApplicationResult = createPlatformApplication(
			applicationName, platform, principal, credential);
	System.out.println(platformApplicationResult);

	// The Platform Application Arn can be used to uniquely identify the
	// Platform Application.
	String platformApplicationArn = platformApplicationResult
			.getPlatformApplicationArn();

	// Create an Endpoint. This corresponds to an app on a device.
	CreatePlatformEndpointResult platformEndpointResult = createPlatformEndpoint(
			platform,
			"CustomData - Useful to store endpoint specific data",
			platformToken, platformApplicationArn);
	System.out.println(platformEndpointResult);

	// Publish a push notification to an Endpoint.
	PublishResult publishResult = publish(
			platformEndpointResult.getEndpointArn(), platform, attrsMap);
	System.out.println("Published! \n{MessageId="
			+ publishResult.getMessageId() + "}");
	// Delete the Platform Application since we will no longer be using it.
	deletePlatformApplication(platformApplicationArn);
}
 
开发者ID:tonchidot,项目名称:aws-java-sns-mobile-push-sample,代码行数:30,代码来源:AmazonSNSClientWrapper.java


示例4: createPlatformArn

import com.amazonaws.services.sns.model.CreatePlatformEndpointResult; //导入依赖的package包/类
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();
}
 
开发者ID:GluuFederation,项目名称:oxAuth,代码行数:13,代码来源:PushSnsService.java


示例5: createPlatformEndpoint

import com.amazonaws.services.sns.model.CreatePlatformEndpointResult; //导入依赖的package包/类
@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());
}
 
开发者ID:awslabs,项目名称:aws-sdk-java-resources,代码行数:11,代码来源:PlatformApplicationImpl.java


示例6: starterNotification

import com.amazonaws.services.sns.model.CreatePlatformEndpointResult; //导入依赖的package包/类
public void starterNotification(Platform platform, String principal,
		String credential, String platformToken, String applicationName,
		Map<Platform, Map<String, MessageAttributeValue>> attrsMap, String message) {
	// Create Platform Application. This corresponds to an app on a
	// platform.
	CreatePlatformApplicationResult platformApplicationResult = createPlatformApplication(
			applicationName, platform, principal, credential);
	System.out.println(platformApplicationResult);

	// The Platform Application Arn can be used to uniquely identify the
	// Platform Application.
	String platformApplicationArn = platformApplicationResult
			.getPlatformApplicationArn();

	// Create an Endpoint. This corresponds to an app on a device.
	CreatePlatformEndpointResult platformEndpointResult = createPlatformEndpoint(
			platform,
			"CustomData - Useful to store endpoint specific data",
			platformToken, platformApplicationArn);
	System.out.println(platformEndpointResult);

	// Publish a push notification to an Endpoint.
	PublishResult publishResult = publish(
			platformEndpointResult.getEndpointArn(), platform, attrsMap, message);
	System.out.println("Published! \n{MessageId="
			+ publishResult.getMessageId() + "}");
	// Delete the Platform Application since we will no longer be using it.
	deletePlatformApplication(platformApplicationArn);
}
 
开发者ID:StarterInc,项目名称:Ignite,代码行数:30,代码来源:AmazonSNSClientWrapper.java


示例7: createPlatformEndpoint

import com.amazonaws.services.sns.model.CreatePlatformEndpointResult; //导入依赖的package包/类
private CreatePlatformEndpointResult createPlatformEndpoint(
        String customData, String platformToken, String applicationArn) {
    CreatePlatformEndpointRequest platformEndpointRequest = new CreatePlatformEndpointRequest();
    platformEndpointRequest.setCustomUserData(customData);
    platformEndpointRequest.setToken(platformToken);
    platformEndpointRequest.setPlatformApplicationArn(applicationArn);
    return snsClient.createPlatformEndpoint(platformEndpointRequest);
}
 
开发者ID:daffodilistic,项目名称:aws-snsmobilepush,代码行数:9,代码来源:SNSMobilePush.java


示例8: createPlatformEndpoint

import com.amazonaws.services.sns.model.CreatePlatformEndpointResult; //导入依赖的package包/类
/**
 * 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);
 
开发者ID:awslabs,项目名称:aws-sdk-java-resources,代码行数:24,代码来源:PlatformApplication.java



注:本文中的com.amazonaws.services.sns.model.CreatePlatformEndpointResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SQLOrderingSpecification类代码示例发布时间:2022-05-23
下一篇:
Java HistoricProcessInstanceEntity类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap