Search code examples
iospush

didFailToRegisterForRemoteNotificationsWithError: user refused error?


If the user refuses the enable push notifications, we'll get an error, through didFailToRegisterForRemoteNotificationsWithError. Does anybody know what the code in the NSError object will be in this case (to differentiate it from, say, no connection being available)?


Solution

  • I don't think your initial statement (always) holds true. If an app is properly signed with a valid provisioning profile, calling registerForRemoteNotificationTypes: will result in application:didRegisterForRemoteNotificationsWithDeviceToken: regardless of the user's Notifications choices in the Settings app. From my experience, the only times I have seen application:didFailToRegisterForRemoteNotificationsWithError: get called was because of an improperly signed app. The error in question mentioned "no valid aps-environment entitlement found for application".