More advanced fixes for push notifications on iOS7

pull/1/head
Frederic Jacobs 11 years ago
parent f8d201fc52
commit 5091c53aa3

@ -20,17 +20,8 @@
#import "Util.h"
#import "VersionMigrations.h"
#import <PastelogKit/Pastelog.h>
#define kSignalVersionKey @"SignalUpdateVersionKey"
#ifdef __APPLE__

@ -111,6 +111,9 @@
if (SYSTEM_VERSION_LESS_THAN(_iOS_8_0)) {
[UIApplication.sharedApplication registerForRemoteNotificationTypes:(UIRemoteNotificationType)self.mandatoryNotificationTypes];
if ([self isMissingMandatoryNotificationTypes]) {
[self.pushNotificationFutureSource trySetFailure:@"Missing Types"];
}
} else {
[UIApplication.sharedApplication registerForRemoteNotifications];
}
@ -175,8 +178,6 @@
} else{
return self.wantRemoteNotifications && (!UIApplication.sharedApplication.isRegisteredForRemoteNotifications);
}
}
-(BOOL) wantRemoteNotifications {

@ -170,7 +170,6 @@
} failure:^(NSURLSessionDataTask *task, NSError *error) {
NSString *alertTitle = NSLocalizedString(@"REGISTRATION_ERROR", @"");
if ([error isKindOfClass:HttpResponse.class]) {
NSHTTPURLResponse* badResponse = (NSHTTPURLResponse*)task.response;
if (badResponse.statusCode == 401) {
SignalAlertView(alertTitle, REGISTER_CHALLENGE_ALERT_VIEW_BODY);
@ -180,10 +179,6 @@
NSString *alertBodyString = [NSString stringWithFormat:@"%@ %lu", NSLocalizedString(@"SERVER_CODE", @""),(unsigned long)badResponse.statusCode];
SignalAlertView (alertTitle, alertBodyString);
}
} else{
Environment.errorNoter(error, @"While Verifying Challenge.", NO);
SignalReportError
}
_challengeButton.enabled = YES;
[_challengeActivityIndicator stopAnimating];

Loading…
Cancel
Save