iPhone real time notification from a server, witho

2019-03-31 20:31发布

问题:

I'm looking for a way to get real time notification from a server in an iPhone App. I don't want to use Apple Push Notification as I have many notifications. My web service is coded in PHP, and I haven't figured out an easy way to implement this functionnality. Any idea what should I do?

Thx a lot for your help!

EDIT : I'm looking for a way to get notification only when the app is launched (otherwise, the only option IS Apple Push not.).

回答1:

If the app is running you can open an http connection from the app to the server and have the server hold it open, pushing data through it when you want. This is basically how COMET works.

This will only work while your app is running. If you need the notification to happen even if the user has closed the app then Apple Push Notifications are your only option.



回答2:

You must use Apple Push Notification for achieving push notifications cycle on Apple's mobile devices.