If the user refuses the enable push notifications, we\'ll get an error, through didFailToRegisterForRemoteNotificationsWithError. Does anybody know what the code in the NSError
To my experience, didFailToRegisterForRemoteNotificationsWithError: method is reserved for more serious cases which prevents the app from even showing the notification permission request dialog to the user. The cases that I know of include the app being run on devices that do not support push notifications, (e.g. Simulator) or some misconfiguration in the aps-environment entitlement in the app binary.