如何保证/确定后,从一个iPhone / iTouch的运行特定的应用程序来吗?应用程序、iPhone、iTouch

2023-09-07 03:00:41 作者:扎着GUCCI腰带的男人

建立一个iPhone OS应用程序,允许用户以匿名方式发布信息的Web应用程序(在我的特定情况下这将是一个基于Rails的网站)...,我想确保我只接受职位,从起源特定的应用程序在iPhone / iTouch的运行。

Building an iPhone OS application that will allow users to anonymously post information to a web application (in my particular case it will be a Rails based site) ... and I want to ensure that I only accept posts that originate from a specific application running on an iPhone/iTouch.

这是如何最好地完成?

(顺便说一句,如果你的答案适用到Android,请随意张贴在这里和我很想知道,如果技术是相同或不同)。

(btw, if your answer applies to Android please feel free to post it here as well as I'm curious to know if the techniques are the same or vary).

感谢

推荐答案

最好的办法是实现一个已知的调用和响应模式。发送某种(整数,字符串,一个时间戳的散列)到iPhone / iTouch的应用程序的价值。有应用程序修改此信息以已知的方式并寄回进行验证。然后,所有你需要做的就是使用每个平台的不同的修改算法,并且将验证哪种类型的设备的使用情况。

The best way would be to implement a known call and response pattern. Send a value of some sort (integer, string, hash of a timestamp) to the iPhone/iTouch application. Have the application modify this information in a known way and send it back for verification. Then all you have to do is use a different modification algorithm per-platform and that will verify what type of device is being used.

很简单的例子:

服务器发送 100 的响应iPhone。 iPhone增加了 10 该数值和发回的请求。 服务器检测到的数值增加了 10 现在知道它是从一个iPhone。 Server sends 100 with the response to an iPhone. iPhone adds 10 to this value and sends back with request. Server detects the value was increased by 10 and now knows it was from an iPhone.

然后在你的Andr​​oid客户端添加 20 键,在另一个平台上添加 30 等等...

Then on your Android clients add 20 and on another platform add 30 and so on...