mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Avoid race and duplication conditions between local and remote notifications (#848)
* added timestamp control of the local notification * improved the code, and implemented the solution, just needs some testing * sdk bump * UserPreference init with initialValue instead of defaultValue * pr suggestions * changelog * notifications sliding sync view added
This commit is contained in:
@@ -22,6 +22,18 @@ extension UNNotificationContent {
|
||||
@objc var receiverID: String? {
|
||||
userInfo[NotificationConstants.UserInfoKey.receiverIdentifier] as? String
|
||||
}
|
||||
|
||||
@objc var notificationID: String? {
|
||||
userInfo[NotificationConstants.UserInfoKey.notificationIdentifier] as? String
|
||||
}
|
||||
|
||||
@objc var roomID: String? {
|
||||
userInfo[NotificationConstants.UserInfoKey.roomIdentifier] as? String
|
||||
}
|
||||
|
||||
@objc var eventID: String? {
|
||||
userInfo[NotificationConstants.UserInfoKey.eventIdentifier] as? String
|
||||
}
|
||||
}
|
||||
|
||||
extension UNMutableNotificationContent {
|
||||
@@ -33,7 +45,34 @@ extension UNMutableNotificationContent {
|
||||
userInfo[NotificationConstants.UserInfoKey.receiverIdentifier] = newValue
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override var roomID: String? {
|
||||
get {
|
||||
userInfo[NotificationConstants.UserInfoKey.roomIdentifier] as? String
|
||||
}
|
||||
set {
|
||||
userInfo[NotificationConstants.UserInfoKey.roomIdentifier] = newValue
|
||||
}
|
||||
}
|
||||
|
||||
override var eventID: String? {
|
||||
get {
|
||||
userInfo[NotificationConstants.UserInfoKey.eventIdentifier] as? String
|
||||
}
|
||||
set {
|
||||
userInfo[NotificationConstants.UserInfoKey.eventIdentifier] = newValue
|
||||
}
|
||||
}
|
||||
|
||||
override var notificationID: String? {
|
||||
get {
|
||||
userInfo[NotificationConstants.UserInfoKey.notificationIdentifier] as? String
|
||||
}
|
||||
set {
|
||||
userInfo[NotificationConstants.UserInfoKey.notificationIdentifier] = newValue
|
||||
}
|
||||
}
|
||||
|
||||
func addMediaAttachment(using mediaProvider: MediaProviderProtocol?,
|
||||
mediaSource: MediaSourceProxy) async -> UNMutableNotificationContent {
|
||||
guard let mediaProvider else {
|
||||
|
||||
Reference in New Issue
Block a user