From 5ff454fd902002abbb03bcd18ded14ce97459fbc Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 31 Mar 2017 23:25:30 -0400 Subject: [PATCH] Fix double creation of NotificationsManager singleton. // FREEBIE --- Podfile.lock | 2 +- .../Notifications/CallNotificationsAdapter.swift | 2 +- Signal/src/environment/NotificationsManager.m | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Podfile.lock b/Podfile.lock index 4b8703c08..4eac84301 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -123,7 +123,7 @@ EXTERNAL SOURCES: AxolotlKit: :git: https://github.com/WhisperSystems/SignalProtocolKit.git SignalServiceKit: - :path: ../SignalServiceKit + :path: "../SignalServiceKit" SocketRocket: :git: https://github.com/facebook/SocketRocket.git diff --git a/Signal/src/UserInterface/Notifications/CallNotificationsAdapter.swift b/Signal/src/UserInterface/Notifications/CallNotificationsAdapter.swift index 3cfd2ca12..d2363ab3c 100644 --- a/Signal/src/UserInterface/Notifications/CallNotificationsAdapter.swift +++ b/Signal/src/UserInterface/Notifications/CallNotificationsAdapter.swift @@ -21,7 +21,7 @@ class CallNotificationsAdapter: NSObject { // if #available(iOS 10.0, *) { // adaptee = UserNotificationsAdaptee() // } else { - adaptee = NotificationsManager() + adaptee = Environment.getCurrent().notificationsManager // } } diff --git a/Signal/src/environment/NotificationsManager.m b/Signal/src/environment/NotificationsManager.m index bf8edcb27..1a2d8261c 100644 --- a/Signal/src/environment/NotificationsManager.m +++ b/Signal/src/environment/NotificationsManager.m @@ -17,12 +17,14 @@ @interface NotificationsManager () -@property SystemSoundID newMessageSound; +@property (nonatomic) SystemSoundID newMessageSound; @property (nonatomic, readonly) NSMutableDictionary *currentNotifications; @property (nonatomic, readonly) NotificationType notificationPreviewType; @end +#pragma mark - + @implementation NotificationsManager - (instancetype)init