objective-c - 我应该为自己的网络浏览器使用哪个用户代理?
问题描述
我目前正在使用这个:
#define CUSTOM_USER_AGENT_IPHONE = "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_2 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Mobile/14F89 Safari/602.1"
我认为这已经过时了。我应该如何去更新这个?每当用户代理更改为更新版本时,我是否应该向 App Store 提交更新版本的 Web 浏览器应用程序?
webView.customUserAgent = self.customUserAgent;
- (NSString *)customUserAgent {
// Checking interface idiom for the appropriate user agent string.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
return @CUSTOM_USER_AGENT_IPHONE;
}
else {
return @CUSTOM_USER_AGENT_IPAD;
}
}
解决方案
推荐阅读
- svg - SVG feGaussianBlur 产生明显的条纹和边缘
- amazon-s3 - 如何为上传到 S3 的图像添加水印
- python - 从 pd.Series() 中时间戳的每个元素中减去每个时间戳的向量
- java - 替换元素
- grails - 如何在 Grails-4 项目中导入 ApplicationHolder?
- c# - C#如何将二维数组中的数据写入文本文件并将它们格式化为列?
- ios - iOS Swift 将基本心率数据作为广播消息探索,无需配对
- ionic-framework - 无法使用 slideNext 和 slideTo 在 ionic5 应用程序中手动更改幻灯片
- csv - 使用 Prometheus 读取 csv 文件
- python - 使用 Biopython 用 GAP 填充短序列