You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-ios/Signal
Michael Kirk f98e57e164 WIP: Fix hanging registration when background modes disabled
fixes #1329

We must register notification settings earlier to be sure we'll be able
to get the users push tokens.

We were previously relying on a quirk of background fetch, a feature
which we don't *actually* use, wherein it's possible to get push tokens
for a user without first prompting them for their notification
settings. More on this from UIApplication.h:

    // Calling this will result in either application:didRegisterForRemoteNotificationsWithDeviceToken: or application:didFailToRegisterForRemoteNotificationsWithError: to be called on the application delegate.
    // ---> Note: these callbacks will be made only if the application has successfully registered for user notifications with registerUserNotificationSettings:, or if it is enabled for Background App Refresh.
    - (void)registerForRemoteNotifications NS_AVAILABLE_IOS(8_0);

In the previous implementation, if a user had disabled background
notifications (e.g.  in order to save battery), we were waiting for push
tokens that would never come.

However, this simple "fix" introduces a UX problem - now we prompt for
an alert in the middle of our registration flow.

// FREEBIE
9 years ago
..
AudioFiles Fixes #244 11 years ago
Certificates TextSecureKit Refactoring 10 years ago
Images Multiple visual enhancements and repo cleanup. 11 years ago
Images.xcassets Disappearing Messages 9 years ago
src WIP: Fix hanging registration when background modes disabled 9 years ago
test Explain send failures for text and media messages 9 years ago
translations Update translations 9 years ago
Signal-Info.plist Convert to non-decimal build numbers. 9 years ago
Signal-Prefix.pch More logging, scrub phone numbers from file logs (#1357) 9 years ago
Signal.entitlements Apple now requires camera permission explanation 9 years ago
iTunesArtwork@3x.png Updated iTunes artwork 11 years ago
main.m Removing unused imported classes. 10 years ago