AWS SNS - Error Domain=com.amazonaws.AWSSNSErrorDomain Code=0 "(null)"

322 views Asked by At

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!)
        }
    })
}
0

There are 0 answers