48 lines
943 B
Swift
48 lines
943 B
Swift
//
|
|
// APPUtils.swift
|
|
// yinmeng-ios
|
|
//
|
|
// Created by yinmeng on 2024/2/22.
|
|
//
|
|
|
|
import Foundation
|
|
import CoreTelephony
|
|
import DeviceKit
|
|
enum TelephonyType: String{
|
|
case Unknow = "0"
|
|
case Mobile = "1"
|
|
case Unicom = "2"
|
|
case Telecom = "3"
|
|
}
|
|
|
|
|
|
public struct APPUtils {
|
|
static var currentCarrierName: String {
|
|
getCurrentCarrierName()
|
|
}
|
|
|
|
static var currentChannle: String {
|
|
getCurrentChannle()
|
|
}
|
|
|
|
static var appVersion: String {
|
|
return Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String
|
|
}
|
|
|
|
static var currentDeveiceId: String {
|
|
var udid = UIDevice.current.identifierForVendor?.uuidString
|
|
udid = udid?.replacingOccurrences(of: "-", with: "")
|
|
udid = udid?.lowercased()
|
|
return udid ?? ""
|
|
}
|
|
}
|
|
|
|
|
|
private extension APPUtils {
|
|
static func getCurrentCarrierName() -> String {
|
|
return TelephonyType.Unicom.rawValue
|
|
}
|
|
|
|
static func getCurrentChannle() -> String { return "yinmeng_appstore"}
|
|
}
|