微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

我应该为自己的 Web 浏览器使用哪个用户代理?

如何解决我应该为自己的 Web 浏览器使用哪个用户代理?

我目前正在使用这个:

#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 提交更新版本的网络浏览器应用?

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;
    }
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。