繁体   English   中英

Amazon SNS AmazonSimpleNotificationServiceClient.Token

[英]Amazon SNS AmazonSimpleNotificationServiceClient.Token

我目前在Windows Store应用程序中停留在CreatePlatformEndpointRequest.Token上。 我不确定从何处/如何获得此令牌。

我已经有我的包裹SID,访问密钥ID和秘密访问密钥

我的密码是

AmazonSimpleNotificationServiceClient sns = new AmazonSimpleNotificationServiceClient("secret", "secret", RegionEndpoint.EUWest1);

d("creating platform endpoint request");
CreatePlatformEndpointRequest createPlatformEndpointRequest = new CreatePlatformEndpointRequest();
createPlatformEndpointRequest.PlatformApplicationArn = "arn:aws:sns:eu-west-1:XXXXXXXXXX:app/WNS/AmazonSNS";
createPlatformEndpointRequest.Token = "what token?";

d("endpoint result");
CreatePlatformEndpointResult createPlatformEndpointResult = await sns.CreatePlatformEndpointAsync(createPlatformEndpointRequest);

d("endpoint arn: " + createPlatformEndpointResult.EndpointArn);

我收到以下错误

"Invalid parameter: Token Reason: Notification Channel URI is not valid"

当然,这是我使用的令牌“什​​么令牌?” 如何以及在何处获取令牌值?

提前致谢

http://docs.aws.amazon.com/sdkfornet1/latest/apidocs/html/T_Amazon_SimpleNotificationService_Model_CreatePlatformEndpointRequest.htm

通知服务为设备上的应用程序创建的唯一标识符。 令牌的具体名称会有所不同,具体取决于所使用的通知服务。 例如,将APNS用作通知服务时,您需要设备令牌。 或者,当使用GCM或ADM时,等效的设备令牌称为注册ID。

手动添加设备令牌或注册ID

  1. 转到https://console.aws.amazon.com/sns/ ,单击“应用程序”,单击您的应用程序,然后单击“添加端点”。
  2. 在“端点令牌”框中,输入令牌ID或注册ID,具体取决于哪种通知服务。 例如,对于ADM和GCM,您输入注册ID。
  3. (可选)在“用户数据”框中,输入任意信息以与端点关联。 Amazon SNS不使用此数据。 数据必须为UTF-8格式且小于2KB。
  4. 最后,单击“添加端点”。

现在,在创建端点之后,您既可以将消息直接发送到移动设备,也可以将消息发送到订阅了主题的移动设备。

参考: http : //docs.aws.amazon.com/sns/latest/dg/mobile-push-send-devicetoken.html

这有帮助吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM