I use Amazon SNS to send push notifications to my iOS app.
For some reason, my endpoints sometimes seem to be set to false β although I know that they are valid endpoints (since re-enabling them then provides new push notifications for the device). There is a similar question about the stack overflow, but there is no technical answer as to how to solve the problem.
So: I need to figure out how to set the endpoint as enabled .
There is only sparse Amazon documentation on how to do this, so I know that I need to use the "enabled" / value key in the attribute dictionary.
My code snippet is as follows:
AmazonSNSClient *sns = [AmazonClientManager sns]; SNSCreatePlatformEndpointRequest *endpointPutRequest = [SNSCreatePlatformEndpointRequest new]; endpointPutRequest.platformApplicationArn = kBXTAWSAppARN; endpointPutRequest.token = deviceToken; [endpointPutRequest setAttributesValue:@"True" forKey:@"Enabled"]; SNSCreatePlatformEndpointResponse *endpointResponse = [sns createPlatformEndpoint:endpointPutRequest];
This works fine except for one line of code that sets the Value "Enabled" attributes to "true". I tried all these combinations:
[endpointPutRequest setAttributesValue:@"true" forKey:@"Enabled"]; [endpointPutRequest setAttributesValue:@"true" forKey:@"enabled"]; [endpointPutRequest setAttributesValue:@"True" forKey:@"Enabled"];
... but none of them work. What is the correct way to write this line of code? Should I use BOOL in some way? Integer?
source share