mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Refactoring
This commit is contained in:
@@ -413,8 +413,7 @@ final class SharedApplicationContext {
|
||||
}, appData: self.deviceToken.get()
|
||||
|> map { token in
|
||||
let data = buildConfig.bundleData(withAppToken: token, signatureDict: signatureDict)
|
||||
if let data = data, let jsonString = String(data: data, encoding: .utf8) {
|
||||
//Logger.shared.log("data", "\(jsonString)")
|
||||
if let data = data, let _ = String(data: data, encoding: .utf8) {
|
||||
} else {
|
||||
Logger.shared.log("data", "can't deserialize")
|
||||
}
|
||||
@@ -632,6 +631,8 @@ final class SharedApplicationContext {
|
||||
return .denied
|
||||
case .notDetermined:
|
||||
return .notDetermined
|
||||
@unknown default:
|
||||
return .notDetermined
|
||||
}
|
||||
} else {
|
||||
return .denied
|
||||
@@ -2155,7 +2156,6 @@ final class SharedApplicationContext {
|
||||
let muteMediaMessageCategory = UIMutableUserNotificationCategory()
|
||||
muteMediaMessageCategory.identifier = "withMuteMedia"
|
||||
|
||||
let categories = [unknownMessageCategory, replyMessageCategory, replyLegacyMessageCategory, replyLegacyMediaMessageCategory, replyMediaMessageCategory, legacyChannelMessageCategory, muteMessageCategory, muteMediaMessageCategory]
|
||||
let settings = UIUserNotificationSettings(types: [.badge, .sound, .alert], categories: [])
|
||||
UIApplication.shared.registerUserNotificationSettings(settings)
|
||||
UIApplication.shared.registerForRemoteNotifications()
|
||||
@@ -2189,9 +2189,7 @@ final class SharedApplicationContext {
|
||||
|
||||
private func maybeCheckForUpdates() {
|
||||
#if targetEnvironment(simulator)
|
||||
return;
|
||||
#endif
|
||||
|
||||
#else
|
||||
guard let buildConfig = self.buildConfig, !buildConfig.isAppStoreBuild, let appCenterId = buildConfig.appCenterId, !appCenterId.isEmpty else {
|
||||
return
|
||||
}
|
||||
@@ -2236,6 +2234,7 @@ final class SharedApplicationContext {
|
||||
}))
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
override var next: UIResponder? {
|
||||
|
||||
Reference in New Issue
Block a user