From c572132c95b3db2842ec714ed0d34a8b0e489a47 Mon Sep 17 00:00:00 2001 From: Frederic Jacobs Date: Thu, 16 Oct 2014 23:14:08 +0200 Subject: [PATCH] Fixing iOS 7 push notification issue #176 will complement this //FREEBIE --- Signal/Signal-Info.plist | 4 ++-- Signal/src/network/PushManager.m | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Signal/Signal-Info.plist b/Signal/Signal-Info.plist index 34ffb9a8a..2bcac3f11 100644 --- a/Signal/Signal-Info.plist +++ b/Signal/Signal-Info.plist @@ -21,11 +21,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0.6 + 1.0.7 CFBundleSignature ???? CFBundleVersion - 1.0.6.2 + 1.0.7 LOGS_EMAIL support@whispersystems.org LOGS_URL diff --git a/Signal/src/network/PushManager.m b/Signal/src/network/PushManager.m index 7311ecddf..d21c4432f 100644 --- a/Signal/src/network/PushManager.m +++ b/Signal/src/network/PushManager.m @@ -164,7 +164,13 @@ } -(BOOL) needToRegisterForRemoteNotifications { - return self.wantRemoteNotifications && !UIApplication.sharedApplication.isRegisteredForRemoteNotifications; + if (SYSTEM_VERSION_LESS_THAN(_iOS_8_0)) { + return self.wantRemoteNotifications; + } else{ + return self.wantRemoteNotifications && (!UIApplication.sharedApplication.isRegisteredForRemoteNotifications); + } + + } -(BOOL) wantRemoteNotifications { @@ -213,11 +219,19 @@ } -(int)allNotificationTypes{ - return UIUserNotificationTypeAlert | UIUserNotificationTypeSound | UIUserNotificationTypeBadge; + if (SYSTEM_VERSION_LESS_THAN(_iOS_8_0)) { + return UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeBadge; + } else { + return UIUserNotificationTypeAlert | UIUserNotificationTypeSound | UIUserNotificationTypeBadge; + } } -(int)mandatoryNotificationTypes{ - return UIUserNotificationTypeAlert | UIUserNotificationTypeSound; + if (SYSTEM_VERSION_LESS_THAN(_iOS_8_0)) { + return UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound; + } else { + return UIUserNotificationTypeAlert | UIUserNotificationTypeSound; + } } @end