I have been trying to understand how to create an app that will receive push notifications from an AWS SNS set up.
I have created the app certificates etc and from what I can see, things should work. I have followed some tutorials and also managed to get my iOS app to receive push notifications sent to APNS from a PHP script run locally on my dev machine.
The thing I appear to be missing is that when I try to set up my AWS SNS app to publish a message to my development device endpoint, it changes the state from Enabled to disabled without any reasoning or error messages coming from the AWS console.
My understanding is that the device token I am using is correct as the PHP script works, my certificates etc are working as this would mean the PHP script would not work and that I must be missing something between the AWS setup and iOS set up.
Some Code:
iOS Setup - works as notifications received from PHP script
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
let defaultServiceConfiguration = AWSServiceConfiguration(region: AWSRegionType.EUWest1, credentialsProvider: credentialsProvider)
AWSServiceManager.defaultServiceManager()
.setDefaultServiceConfiguration(defaultServiceConfiguration)
let notTypes:UIUserNotificationType = UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound
let noteSettings:UIUserNotificationSettings = UIUserNotificationSettings(forTypes: notTypes, categories: nil)
UIApplication.sharedApplication().registerUserNotificationSettings(noteSettings)
return true
}
func application(application: UIApplication, didRegisterUserNotificationSettings notificationSettings: UIUserNotificationSettings) {
UIApplication.sharedApplication().registerForRemoteNotifications()
println("hello from user")
}
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) {
println("recieve!!")
}
AWS Screenshot

If anyone can think of or notice something I am missing here it would be greatly helpful in my learning process!