Don't show permissions pop-up until user has seen contact disclaimer (#1456)

// FREEBIE
pull/1/head
Michael Kirk 9 years ago committed by GitHub
parent 3bbdd13fbe
commit 01a3ef015f

@ -190,13 +190,6 @@
} }
- (void)didAppearForNewlyRegisteredUser - (void)didAppearForNewlyRegisteredUser
{
[self promptNewUserForContactsWithCompletion:^{
[self ensureNotificationsUpToDate];
}];
}
- (void)promptNewUserForContactsWithCompletion:(void (^)())completionHandler
{ {
ABAuthorizationStatus status = ABAddressBookGetAuthorizationStatus(); ABAuthorizationStatus status = ABAddressBookGetAuthorizationStatus();
switch (status) { switch (status) {
@ -212,16 +205,18 @@
actionWithTitle:NSLocalizedString(@"REGISTER_CONTACTS_CONTINUE", nil) actionWithTitle:NSLocalizedString(@"REGISTER_CONTACTS_CONTINUE", nil)
style:UIAlertActionStyleCancel style:UIAlertActionStyleCancel
handler:^(UIAlertAction *action) { handler:^(UIAlertAction *action) {
[self ensureNotificationsUpToDate];
[[Environment getCurrent].contactsManager doAfterEnvironmentInitSetup]; [[Environment getCurrent].contactsManager doAfterEnvironmentInitSetup];
}]]; }]];
[self presentViewController:controller animated:YES completion:completionHandler]; [self presentViewController:controller animated:YES completion:nil];
break; break;
} }
default: { default: {
DDLogError(@"%@ Unexpected for new user to have kABAuthorizationStatus:%ld", self.tag, status); DDLogError(@"%@ Unexpected for new user to have kABAuthorizationStatus:%ld", self.tag, status);
[self ensureNotificationsUpToDate];
[[Environment getCurrent].contactsManager doAfterEnvironmentInitSetup]; [[Environment getCurrent].contactsManager doAfterEnvironmentInitSetup];
completionHandler();
break; break;
} }
} }

Loading…
Cancel
Save