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


I have a listing app for the iPhone app, which always calls a web service on my php server and returns data And it displays on the iPhone screen.

Now, the thing to consider in this scenario is that my iPhone app is requesting on the server every time and brings data.

But now I need to be as if I want to replace the following set of tasks:

-> Every time my application is launched in the iPhone , Then it should check the new data on the server.

-> And if the server answers "truth" then only my iPhone application will be requested to get the data.

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

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

  Table: TB LNewerData ID newDataFlag == ============ True  

Triggers: tgrUpdateNewData

Trigger Up TblNewerData -> newDataFlag

and every time my iPhone app will request the tblNewerData-> newDataFlag field, and if this is true then only this new request will be made, and if it is proved wrong then the data is cached S Skrn will be displayed.

So, I want to know, is this the right way to do this? Or any other smart option is available?

Thanks in advance.

You should instead consider making the field a counter, every time you make any changes to your database Goes, the counter increases.

Now when the iPhone connects, it will compare that counter to the previous counter. If the counter has changed, then he will get updated data.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -