如何获取默认用户代理以发送到标头中的服务器端



我想获取默认的用户代理,即操作系统(ios 10)等信息。我该怎么做?

使用 UIDevice 在 iOS 中获取系统信息。

[[UIDevice currentDevice] systemName]; // e.g. @"iOS"
[[UIDevice currentDevice] systemVersion]; // e.g. @"10.0"
[[UIDevice currentDevice] model]; // e.g. @"iPhone", @"iPod touch"
[[UIDevice currentDevice] localizedModel]; // localized version of model

最新更新