My server is a REST platform (built with asp.net MVC 4 web api), and my client is ios application (in objective-c of course). Currently for all operations the client queries the server with http POST,GET,PUT,DELETE. But there is one situation where the server needs to notify the client that something happened.
The Apple way is a push notification, which is OK when the user authorize push notifications for the app, but I need to notify the app (when its in the foreground) even when the user turn off the push notifications.
now there are 2 ways that it can be done:
- the client query every couple of seconds the server (in http GET) if something happened (are we there yet? are we there yet? :)
- the client open a socket to the server somehow and leave it open, waiting for the server to notify it through the open session that something happened.
So what do u suggest to do? 1 or 2? or is there a third way? and if option 2 can someone lead me to how to do that efficiently? considering that my app should handle above 100,000 active users?
Thank you