How to ensure/determine that a post is coming from an specific application running on an iPhone/iTouch?

前端 未结 4 410
挽巷
挽巷 2021-01-07 15:55

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

4条回答
  •  甜味超标
    2021-01-07 16:25

    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.

    VERY simple example:

    1. Server sends 100 with the response to an iPhone.
    2. iPhone adds 10 to this value and sends back with request.
    3. Server detects the value was increased by 10 and now knows it was from an iPhone.

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

提交回复
热议问题