本文整理汇总了Java中com.amazonaws.services.sns.model.CreatePlatformApplicationRequest.setAttributes方法的典型用法代码示例。如果您正苦于以下问题:Java CreatePlatformApplicationRequest.setAttributes方法的具体用法?Java CreatePlatformApplicationRequest.setAttributes怎么用?Java CreatePlatformApplicationRequest.setAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.amazonaws.services.sns.model.CreatePlatformApplicationRequest
的用法示例。
在下文中一共展示了CreatePlatformApplicationRequest.setAttributes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPlatformApplication
import com.amazonaws.services.sns.model.CreatePlatformApplicationRequest; //导入方法依赖的package包/类
private CreatePlatformApplicationResult createPlatformApplication(
String applicationName, Platform platform, String principal,
String credential) {
CreatePlatformApplicationRequest platformApplicationRequest = new CreatePlatformApplicationRequest();
Map<String, String> attributes = new HashMap<String, String>();
attributes.put("PlatformPrincipal", principal);
attributes.put("PlatformCredential", credential);
platformApplicationRequest.setAttributes(attributes);
platformApplicationRequest.setName(applicationName);
platformApplicationRequest.setPlatform(platform.name());
return snsClient.createPlatformApplication(platformApplicationRequest);
}
示例2: createPlatformApplication
import com.amazonaws.services.sns.model.CreatePlatformApplicationRequest; //导入方法依赖的package包/类
private CreatePlatformApplicationResult createPlatformApplication(
String applicationName, Platform platform, String principal,
String credential) {
/*Creates a platform application object for one of the supported push notification services, such as APNS and GCM,
* to which devices and mobile apps may register. You must specify PlatformPrincipal and PlatformCredential attributes
* when using the CreatePlatformApplication action.
*
* The PlatformPrincipal is received from the notification service.
* ---------------------------------------------------------------------
* For APNS/APNS_SANDBOX, PlatformPrincipal is "SSL certificate".
* For GCM, PlatformPrincipal is not applicable.
* For ADM, PlatformPrincipal is "client id". The PlatformCredential is also received from the notification service.
* -----------------------------------------------------------------------
* For APNS/APNS_SANDBOX, PlatformCredential is "private key".
* For GCM, PlatformCredential is "API key".
* For ADM, PlatformCredential is "client secret".
* --------------------------------------------------------------------------
* The PlatformApplicationArn that is returned when using CreatePlatformApplication is then used as
* an attribute for the CreatePlatformEndpoint action.
* For more information, see Using Amazon SNS Mobile Push Notifications .
* */
CreatePlatformApplicationRequest platformApplicationRequest = new CreatePlatformApplicationRequest();
Map<String, String> attributes = new HashMap<String, String>();
attributes.put("PlatformPrincipal", principal);
attributes.put("PlatformCredential", credential);
platformApplicationRequest.setAttributes(attributes);
platformApplicationRequest.setName(applicationName);
platformApplicationRequest.setPlatform(platform.name());
return snsClient.createPlatformApplication(platformApplicationRequest);
}
示例3: createPlatformApplication
import com.amazonaws.services.sns.model.CreatePlatformApplicationRequest; //导入方法依赖的package包/类
private CreatePlatformApplicationResult createPlatformApplication(
String applicationName, Platform platform, String principal, String credential) {
CreatePlatformApplicationRequest platformApplicationRequest = new CreatePlatformApplicationRequest();
Map<String, String> attributes = new HashMap<String, String>();
attributes.put("PlatformPrincipal", principal);
attributes.put("PlatformCredential", credential);
platformApplicationRequest.setAttributes(attributes);
platformApplicationRequest.setName(applicationName);
platformApplicationRequest.setPlatform(platform.name());
return snsClient.createPlatformApplication(platformApplicationRequest);
}