C# 如何从ListEndpointsByPlatformApplication Amazon SNS C获取用户数据#

C# 如何从ListEndpointsByPlatformApplication Amazon SNS C获取用户数据#,c#,.net,amazon-web-services,amazon-sns,C#,.net,Amazon Web Services,Amazon Sns,我试图弄清楚如何使用AWS简单通知服务向ios应用程序用户发送通知 当我在web应用程序中查看应用程序端点时,我看到: 对于每个注册的设备,我将在用户数据部分存储我们唯一的userId。然后我想发送一个推送,如下所示: public AmazonPushProvider(AmazonProviderObject provider) { _client = new AmazonSimpleNotificationServiceClient(provider.AWSAcce

我试图弄清楚如何使用AWS简单通知服务向ios应用程序用户发送通知

当我在web应用程序中查看应用程序端点时,我看到:

对于每个注册的设备,我将在用户数据部分存储我们唯一的userId。然后我想发送一个推送,如下所示:

public AmazonPushProvider(AmazonProviderObject provider)
{
            _client = new AmazonSimpleNotificationServiceClient(provider.AWSAccessKey, provider.AWSSecretKey);
            _appARN = provider.AppARN;
}

public void SendApplePush(string apsJson, int[] userIds = null)
{
    var iOSModel = _client.ListEndpointsByPlatformApplication(new ListEndpointsByPlatformApplicationRequest { PlatformApplicationArn = _appARN });


    foreach (var endpoint in iOSModel.Endpoints)
    {
        if (endpoint.???)
    }

}

问题在于ListEndpointsByPlatformApplicationRequest似乎没有返回用户数据属性。如何按平台应用程序从端点列表中获取用户数据属性?

一旦获得了平台端点Id,就可以调用GetEndpointAttributes()

返回包含以下信息的响应:

Gets and sets the property Attributes.
Attributes include the following:
CustomUserData -- arbitrary user data to associate with the endpoint. Amazon SNS does not use this data. The data must be in UTF-8 format and less than 2KB.
Enabled -- flag that enables/disables delivery to the endpoint. Amazon SNS will set this to false when a notification service indicates to Amazon SNS that the endpoint is invalid. Users can set it back to true, typically after updating Token.
Token -- device token, also referred to as a registration id, for an app and mobile device. This is returned from the notification service when an app and mobile device are registered with the notification service.