I am using the iOS SDK to set endpoint attributes for an endPoint Arn with the following code-

SNSSetEndpointAttributesRequest *req = [[SNSSetEndpointAttributesRequest alloc] init];
req.endpointArn = arn;
[req setAttributesValue:@"true" forKey:@"Enabled"];
@try {
    [[self sharedClient] setEndpointAttributes:req];
}
@catch (NSException *exception) {
    NSLog(@"Exception is: %@", exception.description);
}

I have verified that the endpoint Arn is valid. However, there seems to be some issue with the format of the attributes and I am not able to figure out the best way to do this. Executing the above code gives the error:

Exception is: AmazonServiceException { RequestId:<reqid>, ErrorCode:MalformedInput, Message:Top level element may not be treated as a list }

Any idea what the proper format would be? The documentation doesn't seems to be a great help either. http://docs.aws.amazon.com/AWSiOSSDK/latest/Classes/SNSSetEndpointAttributesRequest.html

有帮助吗?

解决方案

As you noted, this is indeed a bug in the AWS SDK for iOS. We've addressed in the source on our GitHub repository:

https://github.com/aws/aws-sdk-ios/commit/de19c0d343b34f4fa2819d99db7f425a58cca422

You'll unfortunately need to rebuild the framework in order to pick up this fix. While it only covers the combined framework, you might find this blog post useful in rebuilding the AWSSNS.framework file.

其他提示

Looks like this is a bug that AWS is working on

https://forums.aws.amazon.com/thread.jspa?threadID=134622#

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top