mirror of
https://github.com/tutao/tutanota.git
synced 2025-10-19 16:03:43 +00:00
[ios] Use the same URLSession across the app
Close #8691 Co-authored-by: ivk <ivk@tutao.de>
This commit is contained in:
parent
9627a02bdd
commit
4fc5480453
12 changed files with 86 additions and 166 deletions
|
@ -5,6 +5,7 @@ import tutasdk
|
|||
class NotificationService: UNNotificationServiceExtension {
|
||||
var contentHandler: ((UNNotificationContent) -> Void)?
|
||||
var bestAttemptContent: UNMutableNotificationContent?
|
||||
let urlSession: URLSession = makeUrlSession()
|
||||
|
||||
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
|
||||
self.contentHandler = contentHandler
|
||||
|
@ -47,7 +48,7 @@ class NotificationService: UNNotificationServiceExtension {
|
|||
encryptedPassphraseKey: encryptedPassphraseKey.data,
|
||||
credentialType: tutasdk.CredentialType.internal
|
||||
)
|
||||
let sdk = try await Sdk(baseUrl: origin, rawRestClient: SdkRestClient()).login(credentials: credentials)
|
||||
let sdk = try await Sdk(baseUrl: origin, rawRestClient: SdkRestClient(urlSession: self.urlSession)).login(credentials: credentials)
|
||||
return try await sdk.mailFacade().loadEmailByIdEncrypted(idTuple: tutasdk.IdTupleGenerated(listId: mailId[0], elementId: mailId[1]))
|
||||
}
|
||||
private func getSenderOfMail(_ mail: tutasdk.Mail) -> String {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue