NCPushProxySessionManager.swift 845 B

123456789101112131415161718192021222324
  1. //
  2. // SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  3. // SPDX-License-Identifier: GPL-3.0-or-later
  4. //
  5. import Foundation
  6. @objcMembers public class NCPushProxySessionManager: NCBaseSessionManager {
  7. public static let shared = NCPushProxySessionManager()
  8. init() {
  9. let configuration = URLSessionConfiguration.default
  10. super.init(configuration: configuration, responseSerializer: AFHTTPResponseSerializer(), requestSerializer: AFHTTPRequestSerializer())
  11. self.userAgent += " (Strict VoIP)"
  12. self.updateUserAgent()
  13. // As we can run max. 30s in the background, we need to lower the default timeout from 60s to something < 30s.
  14. // Otherwise our app can be killed when trying to register while in the background
  15. self.requestSerializer.timeoutInterval = 25
  16. }
  17. }