From 111c27aea98e29324e69476ab992b30036635123 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Thu, 20 Aug 2020 17:31:47 +0300 Subject: [PATCH] Rename PushNotificationManager to PushNotificationStore --- Riot.xcodeproj/project.pbxproj | 12 ++++++------ Riot/AppDelegate.m | 4 ++-- .../PushNotification/PushNotificationService.h | 2 +- .../PushNotification/PushNotificationService.m | 4 ++-- ...tionManager.swift => PushNotificationStore.swift} | 4 ++-- RiotNSE/NotificationService.swift | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) rename Riot/Managers/PushNotification/{PushNotificationManager.swift => PushNotificationStore.swift} (96%) diff --git a/Riot.xcodeproj/project.pbxproj b/Riot.xcodeproj/project.pbxproj index 4ee3246f3..3a7157da3 100644 --- a/Riot.xcodeproj/project.pbxproj +++ b/Riot.xcodeproj/project.pbxproj @@ -841,8 +841,8 @@ EC85D754247C0F5B002C44C9 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC85D753247C0F5B002C44C9 /* Constants.swift */; }; EC85D755247C0F84002C44C9 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC85D753247C0F5B002C44C9 /* Constants.swift */; }; EC85D757247E700F002C44C9 /* NSEMemoryStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC85D756247E700F002C44C9 /* NSEMemoryStore.swift */; }; - EC9A3EC524E1616900A8CFAE /* PushNotificationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC9A3EC424E1616900A8CFAE /* PushNotificationManager.swift */; }; - EC9A3EC624E1632C00A8CFAE /* PushNotificationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC9A3EC424E1616900A8CFAE /* PushNotificationManager.swift */; }; + EC9A3EC524E1616900A8CFAE /* PushNotificationStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC9A3EC424E1616900A8CFAE /* PushNotificationStore.swift */; }; + EC9A3EC624E1632C00A8CFAE /* PushNotificationStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC9A3EC424E1616900A8CFAE /* PushNotificationStore.swift */; }; EC9A3EC724E1634100A8CFAE /* KeyValueStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC1CA87124C823E700DE9EBF /* KeyValueStore.swift */; }; EC9A3EC824E1634800A8CFAE /* KeychainStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC1CA87424C8259700DE9EBF /* KeychainStore.swift */; }; ECAE7AE524EC0E01002FA813 /* TableViewSections.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECAE7AE424EC0E01002FA813 /* TableViewSections.swift */; }; @@ -1972,7 +1972,7 @@ EC85D750247C0E8F002C44C9 /* UNUserNotificationCenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UNUserNotificationCenter.swift; sourceTree = ""; }; EC85D753247C0F5B002C44C9 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; }; EC85D756247E700F002C44C9 /* NSEMemoryStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSEMemoryStore.swift; sourceTree = ""; }; - EC9A3EC424E1616900A8CFAE /* PushNotificationManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PushNotificationManager.swift; sourceTree = ""; }; + EC9A3EC424E1616900A8CFAE /* PushNotificationStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PushNotificationStore.swift; sourceTree = ""; }; ECAE7AE424EC0E01002FA813 /* TableViewSections.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableViewSections.swift; sourceTree = ""; }; ECAE7AE624EC15F7002FA813 /* Section.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Section.swift; sourceTree = ""; }; ECAE7AE824EC1888002FA813 /* Row.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Row.swift; sourceTree = ""; }; @@ -4827,7 +4827,7 @@ children = ( EC85D73C2477DDD0002C44C9 /* PushNotificationService.h */, EC85D73D2477DDD0002C44C9 /* PushNotificationService.m */, - EC9A3EC424E1616900A8CFAE /* PushNotificationManager.swift */, + EC9A3EC424E1616900A8CFAE /* PushNotificationStore.swift */, ); path = PushNotification; sourceTree = ""; @@ -5705,7 +5705,7 @@ EC2B4EF224A1EF34005EB739 /* DataProtectionHelper.swift in Sources */, EC85D7462477E5F7002C44C9 /* NotificationService.swift in Sources */, 32FD755424D074C700BA7B37 /* CommonConfiguration.swift in Sources */, - EC9A3EC624E1632C00A8CFAE /* PushNotificationManager.swift in Sources */, + EC9A3EC624E1632C00A8CFAE /* PushNotificationStore.swift in Sources */, 32FD757424D2BEF700BA7B37 /* InfoPlist.swift in Sources */, EC85D752247C0F52002C44C9 /* UNUserNotificationCenter.swift in Sources */, EC9A3EC724E1634100A8CFAE /* KeyValueStore.swift in Sources */, @@ -6168,7 +6168,7 @@ EC711BA924A63B58008F830C /* SecureBackupSetupCoordinatorBridgePresenter.swift in Sources */, B1B558C720EF768F00210D55 /* RoomOutgoingEncryptedTextMsgWithPaginationTitleBubbleCell.m in Sources */, B1B336C5242B933700F95EC4 /* KeyVerificationSelfVerifyStartViewModel.swift in Sources */, - EC9A3EC524E1616900A8CFAE /* PushNotificationManager.swift in Sources */, + EC9A3EC524E1616900A8CFAE /* PushNotificationStore.swift in Sources */, B1B558F020EF768F00210D55 /* RoomOutgoingAttachmentWithPaginationTitleBubbleCell.m in Sources */, 926FA53F1F4C132000F826C2 /* MXSession+Riot.m in Sources */, EC711B8324A63B37008F830C /* SecretsSetupRecoveryPassphraseCoordinator.swift in Sources */, diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index a8e1bfef7..d1fca9253 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -510,7 +510,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni self.localAuthenticationService = [[LocalAuthenticationService alloc] initWithPinCodePreferences:[PinCodePreferences shared]]; - self.pushNotificationService = [[PushNotificationService alloc] initWithPushNotificationManager:PushNotificationManager.shared]; + self.pushNotificationService = [[PushNotificationService alloc] initWithPushNotificationStore:PushNotificationStore.shared]; self.pushNotificationService.delegate = self; // Add matrix observers, and initialize matrix sessions if the app is not launched in background. @@ -2251,7 +2251,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni [PinCodePreferences.shared reset]; // Reset push notification manager - [PushNotificationManager.shared reset]; + [PushNotificationStore.shared reset]; #ifdef MX_CALL_STACK_ENDPOINT // Erase all created certificates and private keys by MXEndpointCallStack diff --git a/Riot/Managers/PushNotification/PushNotificationService.h b/Riot/Managers/PushNotification/PushNotificationService.h index fc45a328a..08ab180f3 100644 --- a/Riot/Managers/PushNotification/PushNotificationService.h +++ b/Riot/Managers/PushNotification/PushNotificationService.h @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN /// Designated initializer /// @param pushNotificationManager Push Notification Manager instance -- (instancetype)initWithPushNotificationManager:(PushNotificationManager *)pushNotificationManager; +- (instancetype)initWithPushNotificationStore:(PushNotificationStore *)pushNotificationManager; /** Is push really registered. diff --git a/Riot/Managers/PushNotification/PushNotificationService.m b/Riot/Managers/PushNotification/PushNotificationService.m index 87e1f4cc2..50af7d3d7 100644 --- a/Riot/Managers/PushNotification/PushNotificationService.m +++ b/Riot/Managers/PushNotification/PushNotificationService.m @@ -31,7 +31,7 @@ @property (nonatomic, nullable, copy) void (^registrationForRemoteNotificationsCompletion)(NSError *); @property (nonatomic, strong) PKPushRegistry *pushRegistry; -@property (nonatomic, strong) PushNotificationManager *pushNotificationManager; +@property (nonatomic, strong) PushNotificationStore *pushNotificationManager; /// Should PushNotificationService receive VoIP pushes @property (nonatomic, assign) BOOL shouldReceiveVoIPPushes; @@ -40,7 +40,7 @@ @implementation PushNotificationService -- (instancetype)initWithPushNotificationManager:(PushNotificationManager *)pushNotificationManager +- (instancetype)initWithPushNotificationStore:(PushNotificationStore *)pushNotificationManager { if (self = [super init]) { diff --git a/Riot/Managers/PushNotification/PushNotificationManager.swift b/Riot/Managers/PushNotification/PushNotificationStore.swift similarity index 96% rename from Riot/Managers/PushNotification/PushNotificationManager.swift rename to Riot/Managers/PushNotification/PushNotificationStore.swift index fb5bd1633..2e592ef64 100644 --- a/Riot/Managers/PushNotification/PushNotificationManager.swift +++ b/Riot/Managers/PushNotification/PushNotificationStore.swift @@ -19,7 +19,7 @@ import KeychainAccess import MatrixSDK @objcMembers -final class PushNotificationManager: NSObject { +final class PushNotificationStore: NSObject { // MARK: - Constants @@ -32,7 +32,7 @@ final class PushNotificationManager: NSObject { static let lastCallInvite: String = "lastCallInvite" } - static let shared = PushNotificationManager() + static let shared = PushNotificationStore() /// Store. Defaults to `KeychainStore` private let store: KeyValueStore diff --git a/RiotNSE/NotificationService.swift b/RiotNSE/NotificationService.swift index 5939b59e3..d47c06993 100644 --- a/RiotNSE/NotificationService.swift +++ b/RiotNSE/NotificationService.swift @@ -40,7 +40,7 @@ class NotificationService: UNNotificationServiceExtension { let url = URL(string: BuildSettings.serverConfigSygnalAPIUrlString)! return MXPushGatewayRestClient(pushGateway: url.scheme! + "://" + url.host!, andOnUnrecognizedCertificateBlock: nil) }() - private var pushNotificationManager: PushNotificationManager = .shared + private var pushNotificationManager: PushNotificationStore = .shared override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { // Set static application settings