mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 14:45:21 +00:00
Fix notification service
This commit is contained in:
@@ -2277,6 +2277,8 @@ private func notificationPayloadKey(data: Data) -> Data? {
|
||||
private func accountIdFromNotification(_ notification: UNNotification, sharedContext: Signal<SharedApplicationContext, NoError>) -> Signal<AccountRecordId?, NoError> {
|
||||
if let id = notification.request.content.userInfo["accountId"] as? Int64 {
|
||||
return .single(AccountRecordId(rawValue: id))
|
||||
} else if let idString = notification.request.content.userInfo["accountId"] as? String, let id = Int64(idString) {
|
||||
return .single(AccountRecordId(rawValue: id))
|
||||
} else {
|
||||
var encryptedData: Data?
|
||||
if var encryptedPayload = notification.request.content.userInfo["p"] as? String {
|
||||
@@ -2336,6 +2338,8 @@ private func accountIdFromNotification(_ notification: UNNotification, sharedCon
|
||||
private func peerIdFromNotification(_ notification: UNNotification) -> PeerId? {
|
||||
if let peerId = notification.request.content.userInfo["peerId"] as? Int64 {
|
||||
return PeerId(peerId)
|
||||
} else if let peerIdString = notification.request.content.userInfo["peerId"] as? String, let peerId = Int64(peerIdString) {
|
||||
return PeerId(peerId)
|
||||
} else {
|
||||
let payload = notification.request.content.userInfo
|
||||
var peerId: PeerId?
|
||||
|
||||
Reference in New Issue
Block a user