mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Stop using CTCarrier for country code detection due to it's deprecation
This commit is contained in:
@@ -3,7 +3,6 @@ import UIKit
|
||||
import AsyncDisplayKit
|
||||
import Display
|
||||
import TelegramCore
|
||||
import CoreTelephony
|
||||
import TelegramPresentationData
|
||||
import PhoneInputNode
|
||||
import CountrySelectionUI
|
||||
@@ -211,18 +210,9 @@ final class ChangePhoneNumberControllerNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
|
||||
var countryId: String? = nil
|
||||
let networkInfo = CTTelephonyNetworkInfo()
|
||||
if let carrier = networkInfo.serviceSubscriberCellularProviders?.values.first {
|
||||
countryId = carrier.isoCountryCode
|
||||
}
|
||||
|
||||
if countryId == nil {
|
||||
countryId = (Locale.current as NSLocale).object(forKey: .countryCode) as? String
|
||||
}
|
||||
|
||||
let countryId = (Locale.current as NSLocale).object(forKey: .countryCode) as? String
|
||||
|
||||
var countryCodeAndId: (Int32, String) = (1, "US")
|
||||
|
||||
if let countryId = countryId {
|
||||
let normalizedId = countryId.uppercased()
|
||||
for (code, idAndName) in countryCodeToIdAndName {
|
||||
|
||||
Reference in New Issue
Block a user