iPhone用户代理 [英] iPhone User Agent

查看:73
本文介绍了iPhone用户代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个iPhone应用程序,该应用程序基本上只显示rss feed中的信息,并从相关网站中拖入一些额外的信息. 我正在考虑添加一些报告代码,例如PinchMedia提供的代码.我确实有一些问题,因为我将在未经许可的情况下监视用户. 因此,我想知道是否有可能仅查看rss提供者收到的请求.

I'm building an iPhone app, that basically just displays information from an rss feed, and drags in some extra info from a related web site. I'm considering to put in some reporting code, eg the code provided by PinchMedia. I do have some issues with that, because I'll be monitoring users without consent. So, I was wondering if it was possible to just take a look at the requests that are received by the rss provider.

在我的代码中,我按以下方式处理提要:

In my code, I approach the feed as follows:

NSString * path = @"http://feeds.feedburner.com/whatever";
[self parseXMLFileAtURL:path];

打开URL时,iPhone是否将任何用户代理信息发送到服务器? 如果是这样,我是否可以通过这种方式进行更改,以便将来自我的应用程序的呼叫与常规的rss客户端区分开来很容易?

Does the iPhone send any User Agent information to the server when opening that URL? If so, can I alter it in such a way, that it would be easy to distinguish a call from my app from regular rss clients?

感谢您的见解!

推荐答案

供您参考,以下是运行OS 3.0版本的iPhone提供的用户代理字符串:

For your reference, here's the User Agent string supplied by an iPhone running the 3.0 version of the OS:

Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16

如Nevan所说,这应该可以让您将iPhone请求与其他请求区分开.

As Nevan says, that should allow you to distinguish iPhone requests from other requests.

这篇关于iPhone用户代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆