mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Notification Handler to handle notifications in foreground (#837)
* changed how the notifications are handled * local notifications can be decrypted and shown! * Improved the handling for the mock and for the normal messages * Avatar images are also displayed * pr ready, commented some code that is not supposed to be releaaed yet, adjusted some tests and added some source code in the targets * fixing some swiftlint complaints and removed an unused function * better swiftlint disable * addressing PR comments
This commit is contained in:
@@ -55,8 +55,6 @@ final class MediaLoaderTests: XCTestCase {
|
||||
}
|
||||
|
||||
private class MockMediaLoadingClient: ClientProtocol {
|
||||
func setNotificationDelegate(notificationDelegate: MatrixRustSDK.NotificationDelegate?) { }
|
||||
|
||||
private(set) var numberOfInvocations = 0
|
||||
|
||||
func getMediaContent(mediaSource: MatrixRustSDK.MediaSource) throws -> [UInt8] {
|
||||
@@ -146,4 +144,6 @@ private class MockMediaLoadingClient: ClientProtocol {
|
||||
}
|
||||
|
||||
func searchUsers(searchTerm: String, limit: UInt64) throws -> MatrixRustSDK.SearchUsersResults { fatalError() }
|
||||
|
||||
func setNotificationDelegate(notificationDelegate: MatrixRustSDK.NotificationDelegate?) { }
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import Combine
|
||||
final class NotificationManagerTests: XCTestCase {
|
||||
var notificationManager: NotificationManager!
|
||||
private let clientProxy = MockClientProxy(userID: "@test:user.net")
|
||||
private lazy var mockUserSession = MockUserSession(clientProxy: clientProxy, mediaProvider: MockMediaProvider())
|
||||
private let notificationCenter = UserNotificationCenterSpy()
|
||||
private var authorizationStatusWasGranted = false
|
||||
private var shouldDisplayInAppNotificationReturnValue = false
|
||||
@@ -35,7 +36,7 @@ final class NotificationManagerTests: XCTestCase {
|
||||
|
||||
notificationManager = NotificationManager(notificationCenter: notificationCenter)
|
||||
notificationManager.start()
|
||||
notificationManager.setClientProxy(clientProxy)
|
||||
notificationManager.setUserSession(mockUserSession)
|
||||
}
|
||||
|
||||
func test_whenRegistered_pusherIsCalled() async {
|
||||
|
||||
Reference in New Issue
Block a user