1

I am using AWS for one of my projects and I am trying to make it so that users are able to create SNS - topics and subscribe to SNS - topics. When doing a request I get Error Domain=com.amazonaws.AWSSNSErrorDomain Code=0 "(null)".

It seems like there are some missing permissions in my project and can't figure out what and where. Also I think this might be related with the fact that the AWS Cognito is in region Ireland (EUWest1) and the AWSSNS and others are in region Frankfurt(EUCentral1).

Is there a way I can change the AWS SNS to the other region, or add permissions in such a way this would work.

Also... I am able to send push notifications to devices from the console.

Here is also the code I use to request a topic creation. Which works on a demo project

func createTopic(topicName: String) {
    let topic = AWSSNSCreateTopicInput()
    topic?.name = topicName

    AWSSNS.default().createTopic(topic!, completionHandler: { topicResponse, error in

        if error != nil {
            print(error.debugDescription)
        }

        if let topicResponse = topicResponse, let myEndpoint = self.myEndpoint {
            self.subscribeToTopic(topicArn: topicResponse.topicArn!)
        }
    })
}
anho
  • 1,705
  • 2
  • 20
  • 38
  • Hi! Did you find the solution? I have the same problem – Alexander Karpov Jun 09 '17 at 09:59
  • Hi Alexander, sorry for the late reply. At the moment I did not find a solution. I was forced to postpone the issue for the moment due to time. Will keep you updated since soon will try to find a fix again – anho Jun 19 '17 at 19:01

0 Answers0