Registration bug also affects other versions of iOS

// FREEBIE
pull/1/head
Michael Kirk 8 years ago committed by Matthew Chen
parent aad93d2d89
commit e84fcd7c94

@ -152,15 +152,13 @@ public enum PushRegistrationError: Error {
} }
/** /**
* work around for iOS11 bug, wherein for users who have disabled notifications * When users have disabled notifications and background fetch, the system hangs when returning a push token.
* and background fetch, the AppDelegate will neither succeed nor fail at registering * More specifically, after registering for remote notification, the app delegate calls neither
* for a vanilla push token. * `didFailToRegisterForRemoteNotificationsWithError` nor `didRegisterForRemoteNotificationsWithDeviceToken`
* This behavior is identical to what you'd see if we hadn't previously registered for user notification settings, though
* in this case we've verified that we *have* properly registered notification settings.
*/ */
private var isSusceptibleToFailedPushRegistration: Bool { private var isSusceptibleToFailedPushRegistration: Bool {
// Only affects iOS11 users
guard #available(iOS 11.0, *) else {
return false
}
// Only affects users who have disabled both: background refresh *and* notifications // Only affects users who have disabled both: background refresh *and* notifications
guard UIApplication.shared.backgroundRefreshStatus == .denied else { guard UIApplication.shared.backgroundRefreshStatus == .denied else {

Loading…
Cancel
Save