亚马逊社交网络 AmazonSimpleNotificationServiceClient.Token

Amazon SNS AmazonSimpleNotificationServiceClient.Token

我的 Windows Store App 目前卡在 CreatePlatformEndpointRequest.Token。我不确定 where/how 是否可以获得此令牌。

我已经有了我的包 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"

这当然是我使用的令牌 "what token?" 我如何以及从哪里获得令牌值?

提前致谢

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

Unique identifier created by the notification service for an app on a device. The specific name for Token will vary, depending on which notification service is being used. For example, when using APNS as the notification service, you need the device token. Alternatively, when using GCM or ADM, the device token equivalent is called the registration 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

这有帮助吗?