How to check for server side update in iPhone application Web service request

Posted by Nirmal on Stack Overflow See other posts from Stack Overflow or by Nirmal
Published on 2010-06-14T10:43:48Z Indexed on 2010/06/16 5:42 UTC
Read the original article Hit count: 504

Hello All....

I have kind of Listing application for iPhone application, which always calling a web service to my php server and fetching the data and displaying it onto iPhone screen.

Now, the thing to consider in this scenario is, my iPhone application everytime requesting on the server and fetching the data.

But now my requirement is like I want to replace following set of actions with above one :

-> Everytime when my application is launched in iPhone, it should check for the new data at the server`.

-> And if server replies "true" then only my iPhone application will made a request to fetch the data.

-> In case of "false", my iPhone application will display the data which is already cached in local phone memory.

Now to implement this scenario at server side (which has php, mysql), I am planning with the following solution :

Table : tblNewerData

id newDataFlag
== ============
1      true

Trigger : tgrUpdateNewData

Above trigger will update the tblNewerData -> newDataFlag field on Insert case of my main table.

And every time my iPhone app will request for tblNewerData->newDataFlag field, and if it found true then only it will create new request, and if it founds false then the cached version of data will be displayed.

So, I want to know that, is it the correct way to do so ? or else any other smart option available ?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk