How should I architect my iPhone app to talk to my website?

前端 未结 6 985
面向向阳花
面向向阳花 2020-12-22 22:58

I\'m planning my first iPhone app and I\'d like to get some inputs as to how to build it, right from the start. The iPhone app is being built to be paired with a public faci

6条回答
  •  不思量自难忘°
    2020-12-22 23:51

    It's quite a broad question, and I think you're going in the right way anyway, however I'll do my best to give some advice:

    JSON, ASIHTTPRequest and POSTs to PHP scripts sound like a great way to go.

    If the data is not really sensitive, I'd use http most of the time, and use https only for a login page that either sets a cookie or returns a "token" that you use in subsequent requests. (HTTPS can be quite slow over a 3G connection as the overhead in terms of number of packets to setup an SSL connection is higher than a plain TCP connection.)

    You should make sure you correctly pass any data from the input to the PHP scripts to the database, to avoid any SQL injection attacks - ie. used parameterised SQL, don't create sql queries by doing "SELECT * from users where username="+$_GET['username']"

提交回复
热议问题