Remote notifications not working - iOS 9

Since iOS 9, my push notifications are not working. I believe this is a client side problem because I checked everything on my server and I am receiving a "success" response from APNS.


Here's how I register for remote notifications:


UIApplication.sharedApplication().registerForRemoteNotifications()


This is executed in

application:didFinishLaunchingWithOptions:


However, the alert asking for permission is not shown and the app is not listed in Settings > Notifications. I tested this on multiple devices running the production app from the store. This worked on iOS 8.


What am I doing wrong?

I'm having issues with push as well but the other way arround (working on iOS9 not iOS8) and managed to get some usefull information from the console using Xcode.

Did you check the console log for error messages? did you try a device where the app has never been installed on? maybe try resetting one of your test devices.

Hmm if you're not getting the alert asking for permission, then you might try deleting the app, reboot etc. That usually works for me during debug cycles. Also your code didn't list that it calls "registerUserNotificationSettings", which "Registers your preferred options for notifying the user." So normally you'd do this:


        let typesIWant: UIUserNotificationType = [.Alert, .Badge, .Sound]
        let mySettings = UIUserNotificationSettings(forTypes: typesIWant, categories: nil)
        application.registerUserNotificationSettings( mySettings )
        application.registerForRemoteNotifications()


You might also try "currentUserNotificationSettings" to see what is set for your app.

Remote notifications not working - iOS 9
 
 
Q