iOS push services: is an invisible push notification possible?

后端 未结 7 581
梦如初夏
梦如初夏 2021-02-02 12:55

I\'m building a iPhone application which depends data from an online database.

To update the data in the app i could check at a certain time interval if an update is ne

7条回答
  •  青春惊慌失措
    2021-02-02 13:44

    I dont' think your is the right approach. Consider all the stuff You will build for a simple task: 1) server for push 2) registering for notification 3) going background and resuming (the big and complicated is the server for push notification)

    and anyway when You got a message, you must ask the data... no savings comparing asking directly.

    So a clean solution can be: 1) ask to the server using normal HTTP (using async NSURL request..) for example: http://...... &lastupdate='2012:05:01 18 00' passing the last update date we got a successful download (You can also use a unicx time stamp...)

    2) the server will compare that date with its internal last update date: if it has newer date, it will respond with XML or plist (i prefer plist...)

    3) the app downloads new data and updates the date/time.

    4) if no data the answer is simply an empty string or for example the same date we sent.

提交回复
热议问题