开发者

Using Remote Web Page to Initialize iPhone App

My iPhone app relies on a vendor's XML feed to provide data. But that feed is not locked down. The vendor could change the format of the XML at any time, although so far they've promised not to.

Since I might want to tell my app to use a different URL for its data source, I'd like to set up a single "Command Central" Web page, on my own server, to direct the app to the correct data source.

In other words, each time my app starts, in the background and unseen by the user, it would visit "http://www.myserver.com/iphoneapp_data_sources.xml" to retrieve the URL for retrieving data from my vendor. That way, if my vendor suddenly changes the exact URL or the XML feed that the app needs, I can update that Web page and开发者_如何学Go ensure that all installations of the app are using the correct XML feed.

Does anyone have any advice or examples showing this kind of approach? It seems as if this must be a common problem, but so far I haven't found a well-established design pattern that fits it.


Instead of connecting your iPhone app directly to the vendor's XML feed, you could use a page on your own server as a proxy. The iPhone app connects with http://www.yourserver.com/proxyxmlfeed.xml, which redirects to the correct vendor URL, http://www.vendorsserver.com/realxmlfeed.xml. This way, if for some reason the real XML feed URL changes, you only have to change the URL the proxyxmlfeed.xml file redirects to, and you're done!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜